Sha256: 3638cf289c24b9d739728f048f5776325c24b0de146debef338dd61f2b2aaac1

Contents?: true

Size: 681 Bytes

Versions: 14

Compression:

Stored size: 681 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe Highrise::User do

  before(:each) do
    @user = Highrise::User.new
  end
  
  it "should be instance of Highrise::Base" do
    @user.kind_of?(Highrise::Base).should be_true
  end
  
  def join(group)
    Membership.create(:user_id => id, :group_id => group.id)
  end
  
  describe ".joind" do

    it "should delegate to Highrise::Membership.create" do
      group_mock = mock("group")
      group_mock.should_receive(:id).and_return(2)
      @user.should_receive(:id).and_return(1)
      Highrise::Membership.should_receive(:create).with({:user_id=>1, :group_id=>2})
      @user.join(group_mock)
    end

  end


end

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
kmayer-highrise-0.11.0 spec/highrise/user_spec.rb
kmayer-highrise-0.11.1 spec/highrise/user_spec.rb
kmayer-highrise-0.12.0 spec/highrise/user_spec.rb
kmayer-highrise-0.13.0 spec/highrise/user_spec.rb
kmayer-highrise-0.8.0 spec/highrise/user_spec.rb
kmayer-highrise-0.8.1 spec/highrise/user_spec.rb
kmayer-highrise-0.9.0 spec/highrise/user_spec.rb
kmayer-highrise-0.9.1 spec/highrise/user_spec.rb
kmayer-highrise-0.9.2 spec/highrise/user_spec.rb
kmayer-highrise-1.0.1 spec/highrise/user_spec.rb
soleone-highrise-0.13.3 spec/highrise/user_spec.rb
highrise-1.0.4 spec/highrise/user_spec.rb
highrise-1.0.3 spec/highrise/user_spec.rb
highrise-1.0.2 spec/highrise/user_spec.rb