Sha256: 348226ed520ea340ae37d4103978eafc9d01878993328c201565a1f7fed69f24

Contents?: true

Size: 634 Bytes

Versions: 3

Compression:

Stored size: 634 Bytes

Contents

require "spec_helper"

describe FactoryGirl::RemoteNotFoundStrategy do
  before { FactoryGirl.remote_not_found(:incident, id: 1) }

  it "registers 404 get url with FakeWeb" do
    expect { Incident.find(1) }.to raise_error ActiveResource::ResourceNotFound
  end

  it "registers search by id as one in array request with empty array" do
    incident = Incident.find(:first, params: { search: { id_in: [1] } })
    expect(incident).to be_nil
  end

  it "registers search by id as exact value request with empty array" do
    incident = Incident.find(:first, params: { search: { id_eq: 1 } })
    expect(incident).to be_nil
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
factory_girl_remote_strategy-0.0.9 spec/factory_girl_remote_not_found_strategy_spec.rb
factory_girl_remote_strategy-0.0.8 spec/factory_girl_remote_not_found_strategy_spec.rb
factory_girl_remote_strategy-0.0.7 spec/factory_girl_remote_not_found_strategy_spec.rb