Sha256: 4521a4c44c7bf321e767cecd0549762ea1fb1fad25658fa5351059c8ae9ee8d3
Contents?: true
Size: 759 Bytes
Versions: 16
Compression:
Stored size: 759 Bytes
Contents
require './spec/spec_helper' class MyResource < Base extend Finders self.element_name = "my_resource" end describe Finders, "Finders model" do before(:each) do stub_auth_request end it "should get first result" do stub_api_get("/my_resource", 'finders.json') resource = MyResource.first resource.Id.should eq(1) end it "should get last result" do stub_api_get("/my_resource", 'finders.json') resource = MyResource.last resource.Id.should eq(2) end it "should find one result" do stub_api_get("/my_resource", 'finders.json', { :_limit => 1, :_filter => "Something Eq 'dude'" }) resource = MyResource.find_one(:_filter => "Something Eq 'dude'") resource.Id.should eq(1) end end
Version data entries
16 entries across 16 versions & 1 rubygems