adds specs for tracking level 2 users
This commit is contained in:
21
spec/features/stats_spec.rb
Normal file
21
spec/features/stats_spec.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
require 'rails_helper'
|
||||
|
||||
feature 'Stats' do
|
||||
|
||||
scenario 'Level 2 user', :focus do
|
||||
admin = create(:administrator)
|
||||
user = create(:user)
|
||||
login_as(user)
|
||||
|
||||
visit account_path
|
||||
click_link 'Verify my account'
|
||||
verify_residence
|
||||
confirm_phone
|
||||
|
||||
login_as(admin.user)
|
||||
visit stats_path
|
||||
|
||||
expect(page).to have_content "Level 2 User (1)"
|
||||
end
|
||||
|
||||
end
|
||||
@@ -110,4 +110,17 @@ module CommonActions
|
||||
click_button 'Verify residence'
|
||||
expect(page).to have_content 'Residence verified'
|
||||
end
|
||||
|
||||
def confirm_phone
|
||||
fill_in 'sms_phone', with: "611111111"
|
||||
click_button 'Send'
|
||||
|
||||
expect(page).to have_content 'Security code confirmation'
|
||||
|
||||
user = User.last.reload
|
||||
fill_in 'sms_confirmation_code', with: user.sms_confirmation_code
|
||||
click_button 'Send'
|
||||
|
||||
expect(page).to have_content 'Correct code'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user