Files
nairobi/spec/features/verification/level_two_verification_spec.rb
Javi Martín db97f9d08c Add and apply rubocop rules for empty lines
We were very inconsistent regarding these rules.

Personally I prefer no empty lines around blocks, clases, etc... as
recommended by the Ruby style guide [1], and they're the default values
in rubocop, so those are the settings I'm applying.

The exception is the `private` access modifier, since we were leaving
empty lines around it most of the time. That's the default rubocop rule
as well. Personally I don't have a strong preference about this one.


[1] https://rubystyle.guide/#empty-lines-around-bodies
2019-10-24 17:11:47 +02:00

41 lines
915 B
Ruby

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