Files
mozo-backend/spec/models/list_spec.rb
T
2012-12-03 18:39:36 +01:00

31 lines
712 B
Ruby

require 'spec_helper'
describe List do
before :each do
@list = create :list
end
describe :as_json do
it 'should include _id in as_json serialization' do
@list.as_json.keys.map(&:to_sym).should include :_id
end
it 'should include table_number in as_json serialization' do
@list.as_json.keys.should include :table_number
end
end
describe :mark_as_payed do
it "should set payed_at to a time" do
@list.payed_at.should be_nil
@list.mark_as_payed
@list.payed_at.should be_kind_of Time
end
it "should set is_payed to true" do
@list.is_payed.should be_false
@list.mark_as_payed
@list.is_payed.should be_true
end
end
end