Sha256: b6c213901edd074e8db0be2ee17e3199b75ce9180b2791bd89181955fce706b4

Contents?: true

Size: 589 Bytes

Versions: 1

Compression:

Stored size: 589 Bytes

Contents

require "spec_helper"

describe BestBoyController do
  before(:each) do
    @user = User.create
  end

  it "should send valid custom event" do
    best_boy_event @user, "testing"
    BestBoyEvent.where(:owner_id => @user.id, :owner_type => @user.class.name.to_s, :event => "testing").first.should_not be_nil
  end

  it "should raise error on empty event_phrase" do
    expect {best_boy_event(@user, "")}.should raise_error
  end

  it "should raise error on class not beeing a eventable" do
    klass = Dummy.new
    expect {best_boy_event(klass, "testing")}.should raise_error
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
best_boy-0.0.3 spec/best_boy/best_boy_controller_spec.rb