test/unit/event_test.rb in clever-ruby-0.6.1 vs test/unit/event_test.rb in clever-ruby-0.6.2
- old
+ new
@@ -1,10 +1,10 @@
require 'test_helper'
# test events resource
-class EventTest < Test::Unit::TestCase
- def setup
+describe Clever::Event do
+ before do
@event = Clever::Event.construct_from(
type: 'sections.created',
data: {
object: { id: '512bb9f2ca5e6fa77506133f' }
},
@@ -22,21 +22,21 @@
},
id: '514767bf80833fb55b1c2dd7'
)
end
- should 'create a clever object for the object the event is about' do
+ it 'creates a clever object for the object the event is about' do
@event.object.must_be_instance_of Clever::Section
end
- should 'know what action the event is about (created/updated/deleted)' do
+ it 'knows what action the event is about (created/updated/deleted)' do
@event.action.must_equal 'created'
end
- should "have an empty hash if there aren't previous attributes" do
+ it "returns an empty hash if there aren't previous attributes" do
@event.previous_attributes.must_equal {}
end
- should "have an event's previous attributes" do
+ it "has an event's previous attributes" do
@updated_event.previous_attributes[:teacher].must_equal '510980a6923bcbba1f0cb500'
end
end