mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-28 13:36:14 +02:00
Tests for filtering
This commit is contained in:
parent
978d9db072
commit
3ef6095b41
4 changed files with 79 additions and 3 deletions
52
features/exporting.feature
Normal file
52
features/exporting.feature
Normal file
|
@ -0,0 +1,52 @@
|
|||
Feature: Expoting a Journal
|
||||
|
||||
Scenario: Exporting to json
|
||||
Given we use the config "tags.json"
|
||||
When we run "jrnl --export json"
|
||||
Then we should get no error
|
||||
and the output should be
|
||||
"""
|
||||
{
|
||||
"entries": [
|
||||
{
|
||||
"body": "(1) write a command line @journal software\n(2) ???\n(3) PROFIT!",
|
||||
"date": "2013-04-09",
|
||||
"time": "15:39",
|
||||
"title": "I have an @idea:"
|
||||
},
|
||||
{
|
||||
"body": "As alway's he shared his latest @idea on how to rule the world with me.",
|
||||
"date": "2013-06-10",
|
||||
"time": "15:40",
|
||||
"title": "I met with @dan."
|
||||
}
|
||||
],
|
||||
"tags": {
|
||||
"@idea": 2,
|
||||
"@journal": 1,
|
||||
"@dan": 1
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
Scenario: Exporting using filters should only export parts of the journal
|
||||
Given we use the config "tags.json"
|
||||
When we run "jrnl -to 'may 2013' --export json"
|
||||
Then we should get no error
|
||||
and the output should be
|
||||
"""
|
||||
{
|
||||
"entries": [
|
||||
{
|
||||
"body": "(1) write a command line @journal software\n(2) ???\n(3) PROFIT!",
|
||||
"date": "2013-04-09",
|
||||
"time": "15:39",
|
||||
"title": "I have an @idea:"
|
||||
}
|
||||
],
|
||||
"tags": {
|
||||
"@idea": 1,
|
||||
"@journal": 1
|
||||
}
|
||||
}
|
||||
"""
|
Loading…
Add table
Add a link
Reference in a new issue