Sha256: f2a6f390d6e943b9526d7015774e45069b9e4328179e1f3751cf19096f93deb1

Contents?: true

Size: 911 Bytes

Versions: 4

Compression:

Stored size: 911 Bytes

Contents

shared_examples 'a user action reading client_id' do
  before do
    allow(File).to receive(:open).and_return("client_id\n#{client_id}")
  end

  it 'uses client_id column' do
    expect(domain).to receive(:clients).with(client_id, nil)
    subject.class.call(params)
  end
end

shared_examples 'a user action filtering segments' do
  let(:organization_not_in_segment) { double('organization') }
  let(:project_not_in_segment) { double('project') }

  before do
    allow(organization_not_in_segment).to receive(:segment_uri).and_return('another-segment-uri')
    allow(organization_not_in_segment).to receive(:project).and_return(project_not_in_segment)
  end

  it 'does operation on project only from clients in segments in segments filter' do
    expect(project).to receive(message_for_project)
    expect(project_not_in_segment).not_to receive(message_for_project)
    subject.class.call(params)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gooddata-1.0.1 spec/unit/actions/shared_examples_for_user_actions.rb
gooddata-1.0.1-java spec/unit/actions/shared_examples_for_user_actions.rb
gooddata-1.0.0-java spec/unit/actions/shared_examples_for_user_actions.rb
gooddata-1.0.0 spec/unit/actions/shared_examples_for_user_actions.rb