spec/eotb_spec.rb in eotb-0.0.1 vs spec/eotb_spec.rb in eotb-0.0.2

- old
+ new

@@ -1,33 +1,22 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper') describe Eotb do - before :each do - @eotb = Eotb.new - end - - it "should have register_event method" do - @eotb.methods.should include(:register_event) - end - - describe ".register_event" do + context "register_event method" do - before :each do - @register_event = @eotb.register_event + it "should return json" do + subject = { :user_id => 10, :user_name => "Noname" } + Eotb.new.register_event(:current_user, :bought_membership, subject).should eql JSON.generate([:current_user, :bought_membership, subject]) end - it "should be an array" do - @register_event.should be_a(Array) - end + end + + context "connection with app" do - it "should have three items" do - @register_event.should have(3).items - end + it "should set connection" - it "last argument should be a hash" do - @register_event[2].should be_a(Hash) - end + it "should send json by POST to app" end end \ No newline at end of file