Remove redundant feature settings enabled in tests
These settings are enabled by default. It could be argued explicitely enabling the features makes tests more consistent, because they'll work if we change the default setting. It could also be argued that it makes tests more expressive because it makes the reader realize certain things will only work if a setting is enabled. However, we were only doing so in a few tests. The truth is, thousands of our tests depend on certain features being enabled. So IMHO we should be consistent and either set them on every test, or not at all. I'm choosing the latter option for simplicity.
This commit is contained in:
@@ -176,13 +176,6 @@ describe "Account" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
context "Recommendations" do
|
context "Recommendations" do
|
||||||
|
|
||||||
before do
|
|
||||||
Setting["feature.user.recommendations"] = true
|
|
||||||
Setting["feature.user.recommendations_on_debates"] = true
|
|
||||||
Setting["feature.user.recommendations_on_proposals"] = true
|
|
||||||
end
|
|
||||||
|
|
||||||
scenario "are enabled by default" do
|
scenario "are enabled by default" do
|
||||||
visit account_path
|
visit account_path
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,6 @@ describe "Budget Investments" do
|
|||||||
:budget_investment,
|
:budget_investment,
|
||||||
"budget_investment_path"
|
"budget_investment_path"
|
||||||
|
|
||||||
before do
|
|
||||||
Setting["feature.allow_images"] = true
|
|
||||||
end
|
|
||||||
|
|
||||||
context "Concerns" do
|
context "Concerns" do
|
||||||
it_behaves_like "notifiable in-app", Budget::Investment
|
it_behaves_like "notifiable in-app", Budget::Investment
|
||||||
it_behaves_like "relationable", Budget::Investment
|
it_behaves_like "relationable", Budget::Investment
|
||||||
|
|||||||
@@ -326,8 +326,6 @@ describe "Commenting topics from proposals" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario "Flagging turbolinks sanity check", :js do
|
scenario "Flagging turbolinks sanity check", :js do
|
||||||
Setting["feature.community"] = true
|
|
||||||
|
|
||||||
community = proposal.community
|
community = proposal.community
|
||||||
topic = create(:topic, community: community, title: "Should we change the world?")
|
topic = create(:topic, community: community, title: "Should we change the world?")
|
||||||
comment = create(:comment, commentable: topic)
|
comment = create(:comment, commentable: topic)
|
||||||
@@ -877,8 +875,6 @@ describe "Commenting topics from budget investments" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario "Flagging turbolinks sanity check", :js do
|
scenario "Flagging turbolinks sanity check", :js do
|
||||||
Setting["feature.community"] = true
|
|
||||||
|
|
||||||
community = investment.community
|
community = investment.community
|
||||||
topic = create(:topic, community: community, title: "Should we change the world?")
|
topic = create(:topic, community: community, title: "Should we change the world?")
|
||||||
comment = create(:comment, commentable: topic)
|
comment = create(:comment, commentable: topic)
|
||||||
|
|||||||
@@ -2,10 +2,6 @@ require "rails_helper"
|
|||||||
|
|
||||||
describe "Communities" do
|
describe "Communities" do
|
||||||
|
|
||||||
before do
|
|
||||||
Setting["feature.community"] = true
|
|
||||||
end
|
|
||||||
|
|
||||||
context "Show" do
|
context "Show" do
|
||||||
|
|
||||||
scenario "Should display default content" do
|
scenario "Should display default content" do
|
||||||
|
|||||||
@@ -455,11 +455,6 @@ describe "Debates" do
|
|||||||
let!(:medium_debate) { create(:debate, title: "Medium", cached_votes_total: 5, tag_list: "Sport") }
|
let!(:medium_debate) { create(:debate, title: "Medium", cached_votes_total: 5, tag_list: "Sport") }
|
||||||
let!(:worst_debate) { create(:debate, title: "Worst", cached_votes_total: 1, tag_list: "Sport") }
|
let!(:worst_debate) { create(:debate, title: "Worst", cached_votes_total: 1, tag_list: "Sport") }
|
||||||
|
|
||||||
before do
|
|
||||||
Setting["feature.user.recommendations"] = true
|
|
||||||
Setting["feature.user.recommendations_on_debates"] = true
|
|
||||||
end
|
|
||||||
|
|
||||||
scenario "can't be sorted if there's no logged user" do
|
scenario "can't be sorted if there's no logged user" do
|
||||||
visit debates_path
|
visit debates_path
|
||||||
expect(page).not_to have_selector("a", text: "recommendations")
|
expect(page).not_to have_selector("a", text: "recommendations")
|
||||||
@@ -975,9 +970,6 @@ describe "Debates" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario "Reorder by recommendations results maintaing search" do
|
scenario "Reorder by recommendations results maintaing search" do
|
||||||
Setting["feature.user.recommendations"] = true
|
|
||||||
Setting["feature.user.recommendations_on_debates"] = true
|
|
||||||
|
|
||||||
user = create(:user, recommended_debates: true)
|
user = create(:user, recommended_debates: true)
|
||||||
login_as(user)
|
login_as(user)
|
||||||
|
|
||||||
|
|||||||
@@ -350,11 +350,6 @@ describe "Emails" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
context "Budgets" do
|
context "Budgets" do
|
||||||
|
|
||||||
before do
|
|
||||||
Setting["process.budgets"] = true
|
|
||||||
end
|
|
||||||
|
|
||||||
let(:author) { create(:user, :level_two) }
|
let(:author) { create(:user, :level_two) }
|
||||||
let(:budget) { create(:budget) }
|
let(:budget) { create(:budget) }
|
||||||
let(:group) { create(:budget_group, name: "Health", budget: budget) }
|
let(:group) { create(:budget_group, name: "Health", budget: budget) }
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ describe "Home" do
|
|||||||
describe "Recommended" do
|
describe "Recommended" do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
Setting["feature.user.recommendations"] = true
|
|
||||||
user = create(:user)
|
user = create(:user)
|
||||||
proposal = create(:proposal, tag_list: "Sport")
|
proposal = create(:proposal, tag_list: "Sport")
|
||||||
create(:follow, followable: proposal, user: user)
|
create(:follow, followable: proposal, user: user)
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ describe "Proposals" do
|
|||||||
context "Index" do
|
context "Index" do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
Setting["feature.allow_images"] = true
|
|
||||||
Setting["feature.featured_proposals"] = true
|
Setting["feature.featured_proposals"] = true
|
||||||
Setting["featured_proposals_number"] = 3
|
Setting["featured_proposals_number"] = 3
|
||||||
end
|
end
|
||||||
@@ -766,11 +765,6 @@ describe "Proposals" do
|
|||||||
let!(:medium_proposal) { create(:proposal, title: "Medium", cached_votes_up: 5, tag_list: "Sport") }
|
let!(:medium_proposal) { create(:proposal, title: "Medium", cached_votes_up: 5, tag_list: "Sport") }
|
||||||
let!(:worst_proposal) { create(:proposal, title: "Worst", cached_votes_up: 1, tag_list: "Sport") }
|
let!(:worst_proposal) { create(:proposal, title: "Worst", cached_votes_up: 1, tag_list: "Sport") }
|
||||||
|
|
||||||
before do
|
|
||||||
Setting["feature.user.recommendations"] = true
|
|
||||||
Setting["feature.user.recommendations_on_proposals"] = true
|
|
||||||
end
|
|
||||||
|
|
||||||
scenario "can't be sorted if there's no logged user" do
|
scenario "can't be sorted if there's no logged user" do
|
||||||
visit proposals_path
|
visit proposals_path
|
||||||
expect(page).not_to have_selector("a", text: "recommendations")
|
expect(page).not_to have_selector("a", text: "recommendations")
|
||||||
@@ -1509,9 +1503,6 @@ describe "Proposals" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario "Reorder by recommendations results maintaing search" do
|
scenario "Reorder by recommendations results maintaing search" do
|
||||||
Setting["feature.user.recommendations"] = true
|
|
||||||
Setting["feature.user.recommendations_for_proposals"] = true
|
|
||||||
|
|
||||||
user = create(:user, recommended_proposals: true)
|
user = create(:user, recommended_proposals: true)
|
||||||
login_as(user)
|
login_as(user)
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,6 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p
|
|||||||
let!(:imageable) { create(imageable_factory_name) }
|
let!(:imageable) { create(imageable_factory_name) }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
|
||||||
Setting["feature.allow_images"] = true
|
|
||||||
|
|
||||||
imageable_path_arguments&.each do |argument_name, path_to_value|
|
imageable_path_arguments&.each do |argument_name, path_to_value|
|
||||||
arguments.merge!("#{argument_name}": imageable.send(path_to_value))
|
arguments.merge!("#{argument_name}": imageable.send(path_to_value))
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user