@disable-bundler @rails-app Feature: Facilitating translation of Banyan Categories Background: Given I setup a new rails app "dummy" And I append to "Gemfile" with: """ gem 'banyan', path: "../../.." """ And a file named "config/environment.rb" with: """ Encoding.default_external = Encoding::UTF_8 Encoding.default_internal = Encoding::UTF_8 # Load the rails application require File.expand_path('../application', __FILE__) # Initialize the rails application Dummy::Application.initialize! """ And I successfully run `bundle install` for up to 24 seconds And I install banyan And a file named "config/locales/de.yml" with: """ de: hello: hallo """ And a file named "config/locales/fr.yml" with: """ fr: hello: bonjour """ And I seed the database with Categories: | tag | name | | Business | Business| | Tools & Utilities | Tools & Utilities | And I seed the database with Groups: | tag | name | | appzone | AppZone | | categories | Categories | | form_factors | Form Factors | Scenario: Exporting Banyan Category Translations When I run `bundle exec rake translations:categories:export[current_translations.yml]` Then the file "current_translations.yml" should contain "en:" And the file "current_translations.yml" should be valid yaml Scenario: Importing Banyan Category Translations Given a file named "new_translations.yml" with: """ --- banyan_category_translations: de: Business: Unternehmen_DE "Tools & Utilities": Werkzeuge und Hilfsprogramme_DE banyan_category_group_translations: de: appzone: AppZone_DE categories: Kategorien_DE form_factors: Formfaktoren_DE """ When I run `bundle exec rake translations:categories:import[new_translations.yml]` Then the output should contain "Updated 5 translations" Scenario: Import and Export Given a file named "new_translations.yml" with: """ --- banyan_category_translations: de: Business: Unternehmen "Tools & Utilities": Werkzeuge und Hilfsprogramme banyan_category_group_translations: de: appzone: AppZone categories: Kategorien form_factors: Formfaktoren """ And I run `rake translations:categories:import[new_translations.yml]` When I run `rake translations:categories:export[current_translations.yml]` Then the file "current_translations.yml" should contain "form_factors: Formfaktoren" Scenario: Export and Import (and Export) Given I run `bundle exec rake translations:categories:export[new_fr_translations.yml]` And I translate "banyan_category_translations.fr.Tools & Utilities" to "Outils & Utilitaires" into "new_fr_translations.yml" And I translate "banyan_category_group_translations.fr.categories" to "Catégories" into "new_fr_translations.yml" When I run `rake translations:categories:import[new_fr_translations.yml]` Then the output should contain "Updated 2 translations" And I run `rake translations:categories:export[current_translations.yml]` Then the file "current_translations.yml" should contain "Tools & Utilities: Outils & Utilitaires" And the file "current_translations.yml" should contain "categories: Catégories"