Sha256: c33279e582ffcc6c65ff9f4f4a324f2ae67a6974f408306b0bd4b61cad46d121

Contents?: true

Size: 819 Bytes

Versions: 1

Compression:

Stored size: 819 Bytes

Contents

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

describe ContactsController do

  render_views

  before(:all) do
    @tie = Factory(:friend)
    @user = @tie.sender_subject
  end

  it "should be successful" do
    sign_in @user

    get 'index'
    response.should be_success
  end

  it "should render edit" do
    sign_in @user

    get :edit, :id => @tie.contact_id

    assert_response :success
  end

  it "should render update" do
    sign_in @user

    put :update, :id => @tie.contact_id,
                 :contact => { "relation_ids" => [ "gotcha", @user.relations.last.id ] }

    response.should redirect_to(@tie.receiver_subject)
    @user.reload.
      sent_ties.
      merge(Contact.received_by(@tie.receiver)).
      first.relation.
      should == @user.relations.last
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
social_stream-base-0.6.0 spec/controllers/contacts_controller_spec.rb