diff --git a/spec/models/order_spec.rb b/spec/models/order_spec.rb index 0fe452f0a..86e70914d 100644 --- a/spec/models/order_spec.rb +++ b/spec/models/order_spec.rb @@ -12,7 +12,13 @@ it { should_not allow_mass_assignment_of :uuid } it "generates UUID before validation on_create" do - # TODO + order = Order.new.tap do |o| + o.name = 'marin' + o.user_id = 12983 + o.price = 123.12 + end + order.should_receive(:generate_uuid!) + order.save! end it { Order.primary_key.should == 'uuid' } @@ -204,4 +210,4 @@ end -end \ No newline at end of file +end