Use system specs instead of feature specs

We get rid of database cleaner, and JavaScript tests are faster because
between tests we now rollback transactions instead of truncating the
database.
This commit is contained in:
Javi Martín
2019-04-29 12:26:17 +02:00
parent 12774c7484
commit 9427f01442
190 changed files with 14 additions and 54 deletions

View File

@@ -0,0 +1,40 @@
require "rails_helper"
describe "Level two verification" do
scenario "Verification with residency and sms" do
create(:geozone)
user = create(:user)
login_as(user)
visit account_path
click_link "Verify my account"
verify_residence
fill_in "sms_phone", with: "611111111"
click_button "Send"
expect(page).to have_content "Security code confirmation"
user = user.reload
fill_in "sms_confirmation_code", with: user.sms_confirmation_code
click_button "Send"
expect(page).to have_content "Code correct"
end
context "In Spanish, with no fallbacks" do
before do
skip unless I18n.available_locales.include?(:es)
allow(I18n.fallbacks).to receive(:[]).and_return([:es])
end
scenario "Works normally" do
user = create(:user)
login_as(user)
visit verification_path(locale: :es)
verify_residence
end
end
end