Skip to content
This repository has been archived by the owner on Nov 21, 2017. It is now read-only.

Commit

Permalink
clean up mobile recovery spec changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Papazian committed Oct 7, 2014
1 parent 8884591 commit 055b08e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
13 changes: 3 additions & 10 deletions spec/features/mobile_confirmation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def receive_code
end

def enter_code!(code)
@mobile_confirmation_page.mobile_number_confirmation_token.set code # 'bad token'
@mobile_confirmation_page.mobile_number_confirmation_token.set code
@mobile_confirmation_page.submit.click
end

Expand Down Expand Up @@ -64,18 +64,11 @@ def enter_code!(code)
end

scenario 'user can resend code' do
open_last_text_message_for(phone_number)
expect(current_text_message.body).to match(/Your MyUSA verification code is \d{6}/)
first_token = current_text_message.body.match /\d{6}/

first_token = receive_code
@mobile_confirmation_page.resend.click

expect(@mobile_confirmation_page).to be_displayed
open_last_text_message_for(phone_number)
expect(current_text_message.body).to match(/Your MyUSA verification code is \d{6}/)
second_token = current_text_message.body.match /\d{6}/

expect(first_token).to_not match(second_token)
expect(first_token).to_not match(receive_code)
end
end
end
2 changes: 1 addition & 1 deletion spec/lib/email_authenticatable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def env_with_params(path = "/", params = {}, env = {})
expect(subject.result).to eq(:failure)
end

it 'sets messgae' do
it 'sets message' do
subject.authenticate!
expect(subject.message).to eq(:invalid)
end
Expand Down

0 comments on commit 055b08e

Please sign in to comment.