Skip to content

Commit

Permalink
Add spec for #new
Browse files Browse the repository at this point in the history
  • Loading branch information
phildionne committed Nov 5, 2013
1 parent 53ff5ec commit ec1de23
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/associates_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,16 @@
expect(guest_order).to respond_to(:payment)
end

describe :new do
let(:guest_order) { GuestOrder.new(username: 'phildionne', password: '123456789', product: 'surfboard') }

it "works with ActiveModel::Model #new" do
expect(guest_order.username).to eq('phildionne')
expect(guest_order.password).to eq('123456789')
expect(guest_order.product).to eq('surfboard')
end
end

describe :instance_setter do

it "sets its dependent associate relation" do
Expand Down

0 comments on commit ec1de23

Please sign in to comment.