Sha256: daf18df44b83ae9a30e98335f0c744469e102601ecffb56e701da4fb71bc69b6
Contents?: true
Size: 1.24 KB
Versions: 16
Compression:
Stored size: 1.24 KB
Contents
require 'spec_helper' describe "has_many" do describe_example "has_one/simple" do it 'parses properly' do @root.id.should == 123 @root.login.should == 'jackiechan2010' end describe "#resource" do subject {@root.resource} it 'has a link' do subject[:link].should be_an(Array) end it "has a billing relation" do subject[:link].any? {|l| l[:rel] == :billing}.should be_true end it "has a href for billing relation" do link = subject[:link].find {|l| l[:rel] == :billing} link[:href].should =~ %r{/customers/123/billing} end end end describe_example "has_one/href_options" do it 'parses properly' do @root.id.should == 123 @root.login.should == 'jackiechan2010' end describe "#resource" do subject {@root.resource} it 'has a link' do subject[:link].should be_an(Array) end it "has a billing relation" do subject[:link].any? {|l| l[:rel] == :billing}.should be_true end it "has a href for billing relation" do link = subject[:link].find {|l| l[:rel] == :billing} link[:href].should =~ %r{http://external.service.com/customers/123/billing} end end end end
Version data entries
16 entries across 16 versions & 1 rubygems