module G5FoundationClient::RspecHelpers

Public Instance Methods

stub_client_for_uid(uid, client = nil) click to toggle source
# File lib/g5_foundation_client/rspec.rb, line 13
def stub_client_for_uid(uid, client = nil)
  client ||= FactoryGirl.build(:g5_client)

  G5FoundationClient::Client.
    stub(:find_by_uid).
    with(uid).
    and_return(client)

  client
end
stub_location_for_uid(uid, location = nil) click to toggle source
# File lib/g5_foundation_client/rspec.rb, line 2
def stub_location_for_uid(uid, location = nil)
  location ||= FactoryGirl.build(:g5_location)

  G5FoundationClient::Location.
    stub(:find_by_uid).
    with(uid).
    and_return(location)

  location
end