Skip to content

Commit

Permalink
Fixing tests after changing phone field
Browse files Browse the repository at this point in the history
  • Loading branch information
ialbuqu committed Oct 28, 2013
1 parent bfabc41 commit af597a9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion spec/factories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
end

factory :reservation do
phone_number {"(81) 8855-5522"}
phone_number {"(81) 88555-552"}
email {"[email protected]"}
end

Expand Down
2 changes: 1 addition & 1 deletion spec/models/bill_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
context 'update reservation status' do
it 'verify if the bill reservation status is updated back to opened' do
bill.update_attributes(status: :reserved)
reservation = bill.build_reservation(:email => '[email protected]', :phone_number => '(81) 9999-1111')
reservation = bill.build_reservation(:email => '[email protected]', :phone_number => '(81) 99999-1111')
reservation.date = DateTime.yesterday
reservation.save!

Expand Down
7 changes: 4 additions & 3 deletions spec/models/reservation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
end

context :phone_number do
it { should validate_format_of(:phone_number).to_allow("+55 (81) 3034-5626") }
it { should validate_format_of(:phone_number).to_allow("(81) 8855-5522") }
it { should validate_format_of(:phone_number).to_allow("55 (81) 30342-5612") }
it { should validate_format_of(:phone_number).to_allow("(81) 88555-5522") }
it { should validate_format_of(:phone_number).to_allow("(81) 32155-522") }
it { should validate_format_of(:phone_number).to_allow("55 (81) 30342-5621") }
it { should validate_format_of(:phone_number).not_to_allow("8199887711") }
it { should validate_format_of(:phone_number).not_to_allow("(81) s8aa5-5522") }
it { should validate_format_of(:phone_number).not_to_allow("2316418374651308465013465") }
Expand All @@ -38,7 +40,6 @@
end

context :validations do
it { should validate_presence_of(:phone_number) }
it { should validate_presence_of(:email) }
end

Expand Down

0 comments on commit af597a9

Please sign in to comment.