features/update.feature in localeapp-2.1.1 vs features/update.feature in localeapp-2.2.0

- old
+ new

@@ -1,38 +1,29 @@ -Feature: Getting new translations +Feature: `update' command - Scenario: Running update - In order to receive the translations that have been updated since the last check + Scenario: Fetches translations Given I have a valid project on localeapp.com with api key "MYAPIKEY" - And an initializer file - And the timestamp is 2 months old - And new translations for the api key "MYAPIKEY" since last fetch with time "60" seconds later - And a directory named "config/locales" - When I run `localeapp update` + And an initializer file + And the timestamp is 2 months old + And new translations for the api key "MYAPIKEY" since last fetch with time "60" seconds later + And a directory named "config/locales" + When I successfully run `localeapp update` Then translations should be fetched since last fetch only - And help should not be displayed - And a file named "config/locales/en.yml" should exist - # check the content here - # and the localeapp.yml file + And a file named "config/locales/en.yml" should exist - Scenario: Running update with no initializer file, passing the key on the command line - In order to receive the translations that have been updated since the last check + Scenario: Reports an error when timestamp is too old Given I have a valid project on localeapp.com with api key "MYAPIKEY" - And the timestamp is 2 months old - And new translations for the api key "MYAPIKEY" since last fetch with time "60" seconds later - And a directory named "config/locales" - When I run `localeapp -k MYAPIKEY update` - Then translations should be fetched since last fetch only - And help should not be displayed - And a file named "config/locales/en.yml" should exist - - Scenario: Running update with a too old timestamp - In order to receive the translations that have been updated since the last check - Given I have a valid project on localeapp.com with api key "MYAPIKEY" - And an initializer file - And the timestamp is 8 months old - When I run `localeapp update` + And an initializer file + And the timestamp is 8 months old + When I successfully run `localeapp update` Then the output should contain: """ Timestamp is missing or too old """ - And help should not be displayed + + Scenario: Reports an error when the given API key is incorrect + Given no project exist on localeapp.com with API key "MYAPIKEY" + And the timestamp is 2 months old + And a directory named "config/locales" + When I run `localeapp -k MYAPIKEY update` + Then the exit status must be 70 + And the output must match /error.+404/i