Remove redundant setting resets in after blocks
Settings are stored in the database, and so any changes to the settings done during the tests are automatically rolled back between one test and the next one. There were also a few places where we weren't using an `after` block but changing the setting at the end of the test.
This commit is contained in:
@@ -71,10 +71,6 @@ shared_examples "documentable" do |documentable_factory_name, documentable_path,
|
||||
Setting["feature.allow_attached_documents"] = true
|
||||
end
|
||||
|
||||
after do
|
||||
Setting["feature.allow_attached_documents"] = false
|
||||
end
|
||||
|
||||
scenario "Documents list should be available" do
|
||||
login_as(user)
|
||||
visit send(documentable_path, arguments)
|
||||
@@ -98,10 +94,6 @@ shared_examples "documentable" do |documentable_factory_name, documentable_path,
|
||||
Setting["feature.allow_attached_documents"] = false
|
||||
end
|
||||
|
||||
after do
|
||||
Setting["feature.allow_attached_documents"] = true
|
||||
end
|
||||
|
||||
scenario "Documents list should not be available" do
|
||||
login_as(create(:user))
|
||||
visit send(documentable_path, arguments)
|
||||
|
||||
Reference in New Issue
Block a user