Use JavaScript in system tests by default
JavaScript is used by about 98% of web users, so by testing without it enabled, we're only testing that the application works for a very reduced number of users. We proceeded this way in the past because CONSUL started using Rails 4.2 and truncating the database between JavaScript tests with database cleaner, which made these tests terribly slow. When we upgraded to Rails 5.1 and introduced system tests, we started using database transactions in JavaScript tests, making these tests much faster. So now we can use JavaScript tests everywhere without critically slowing down our test suite.
This commit is contained in:
@@ -95,7 +95,7 @@ shared_examples "documentable" do |documentable_factory_name, documentable_path,
|
||||
end
|
||||
|
||||
context "Destroy" do
|
||||
scenario "Should show success notice after successful document upload", :js do
|
||||
scenario "Should show success notice after successful document upload" do
|
||||
login_as documentable.author
|
||||
|
||||
visit send(documentable_path, arguments)
|
||||
@@ -107,7 +107,7 @@ shared_examples "documentable" do |documentable_factory_name, documentable_path,
|
||||
expect(page).to have_content "Document was deleted successfully."
|
||||
end
|
||||
|
||||
scenario "Should hide documents tab if there is no documents", :js do
|
||||
scenario "Should hide documents tab if there is no documents" do
|
||||
login_as documentable.author
|
||||
|
||||
visit send(documentable_path, arguments)
|
||||
@@ -119,7 +119,7 @@ shared_examples "documentable" do |documentable_factory_name, documentable_path,
|
||||
expect(page).not_to have_content "Documents (0)"
|
||||
end
|
||||
|
||||
scenario "Should redirect to documentable path after successful deletion", :js do
|
||||
scenario "Should redirect to documentable path after successful deletion" do
|
||||
login_as documentable.author
|
||||
|
||||
visit send(documentable_path, arguments)
|
||||
|
||||
Reference in New Issue
Block a user