diff --git a/spec/features/budgets/investments_spec.rb b/spec/features/budgets/investments_spec.rb index 3da6a4571..2e136e041 100644 --- a/spec/features/budgets/investments_spec.rb +++ b/spec/features/budgets/investments_spec.rb @@ -24,16 +24,11 @@ describe "Budget Investments" do context "Concerns" do it_behaves_like "notifiable in-app", Budget::Investment it_behaves_like "relationable", Budget::Investment - context "Translatable at front end" do - before do - Setting["feature.translation_interface"] = true - end - it_behaves_like "new_translatable", - "budget_investment", - "new_budget_investment_path", - %w[title], - { "description" => :ckeditor } - end + it_behaves_like "new_translatable", + "budget_investment", + "new_budget_investment_path", + %w[title], + { "description" => :ckeditor } end context "Load" do diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index 74c88f758..8c58682f5 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -11,21 +11,16 @@ describe "Debates" do context "Concerns" do it_behaves_like "notifiable in-app", Debate it_behaves_like "relationable", Debate - context "Translatable at front end" do - before do - Setting["feature.translation_interface"] = true - end - it_behaves_like "new_translatable", - "debate", - "new_debate_path", - %w[title], - { "description" => :ckeditor } - it_behaves_like "edit_translatable", - "debate", - "edit_debate_path", - %w[title], - { "description" => :ckeditor } - end + it_behaves_like "new_translatable", + "debate", + "new_debate_path", + %w[title], + { "description" => :ckeditor } + it_behaves_like "edit_translatable", + "debate", + "edit_debate_path", + %w[title], + { "description" => :ckeditor } end scenario "Index" do diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index 8a8d56e8c..bfaef572c 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -15,21 +15,16 @@ describe "Proposals" do context "Concerns" do it_behaves_like "notifiable in-app", Proposal it_behaves_like "relationable", Proposal - context "Translatable at front end" do - before do - Setting["feature.translation_interface"] = true - end - it_behaves_like "new_translatable", - "proposal", - "new_proposal_path", - %w[title summary], - { "description" => :ckeditor } - it_behaves_like "edit_translatable", - "proposal", - "edit_proposal_path", - %w[title summary], - { "description" => :ckeditor } - end + it_behaves_like "new_translatable", + "proposal", + "new_proposal_path", + %w[title summary], + { "description" => :ckeditor } + it_behaves_like "edit_translatable", + "proposal", + "edit_proposal_path", + %w[title summary], + { "description" => :ckeditor } end context "Index" do diff --git a/spec/shared/features/edit_translatable.rb b/spec/shared/features/edit_translatable.rb index 245d1abee..54af5794a 100644 --- a/spec/shared/features/edit_translatable.rb +++ b/spec/shared/features/edit_translatable.rb @@ -46,7 +46,11 @@ shared_examples "edit_translatable" do |factory_name, path_name, input_fields, t before do login_as(user) - translatable.update(author: user) if front_end_path_to_visit?(path_name) + + if front_end_path_to_visit?(path_name) + Setting["feature.translation_interface"] = true + translatable.update(author: user) + end end context "Manage translations" do diff --git a/spec/shared/features/new_translatable.rb b/spec/shared/features/new_translatable.rb index c66a9770e..56fb6a028 100644 --- a/spec/shared/features/new_translatable.rb +++ b/spec/shared/features/new_translatable.rb @@ -43,6 +43,7 @@ shared_examples "new_translatable" do |factory_name, path_name, input_fields, te end before do + Setting["feature.translation_interface"] = true login_as(user) end