Sha256: 957594eedf20e643624733a697af6e05f9051e68cc5fb81aed97538358cdac47

Contents?: true

Size: 652 Bytes

Versions: 9

Compression:

Stored size: 652 Bytes

Contents

require 'spec_helper'

describe ClientNotesController, :type => :controller do

  it 'should map powers with context' do
    @client1 = Client.create!
    @client1_note1 = @client1.notes.create!
    @client2 = Client.create!
    @client2_note1 = @client2.notes.create!
    controller.stub(
      :current_power => Power.new,
      :client => @client1
    )
    controller.send(:note_scope).to_a.should == [@client1_note1]
  end

  it 'should fail if a context is missing' do
    controller.stub(
      :current_power => Power.new,
      :client => nil
    )
    expect { controller.send(:note_scope) }.to raise_error(Consul::MissingContext)
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
consul-0.12.2 spec/shared/consul/controllers/client_notes_controller_spec.rb
consul-0.12.1 spec/shared/consul/controllers/client_notes_controller_spec.rb
consul-0.12.0 spec/shared/consul/controllers/client_notes_controller_spec.rb
consul-0.11.2 spec/shared/consul/controllers/client_notes_controller_spec.rb
consul-0.11.1 spec/shared/consul/controllers/client_notes_controller_spec.rb
consul-0.11.0 spec/shared/consul/controllers/client_notes_controller_spec.rb
consul-0.10.2 spec/shared/consul/controllers/client_notes_controller_spec.rb
consul-0.10.1 spec/shared/consul/controllers/client_notes_controller_spec.rb
consul-0.10.0 spec/shared/consul/controllers/client_notes_controller_spec.rb