Sha256: bbd85bd27bb4ff5b25683b98e3075d29dbc09c3fc5bf295a0552b7a53faa89e5

Contents?: true

Size: 707 Bytes

Versions: 12

Compression:

Stored size: 707 Bytes

Contents

require 'spec_helper'

describe "has_many" do
  describe_example "has_many/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

      [:services, :billing, :devops].each do |rel|
        it "has a #{rel} relation" do
          subject[:link].any? {|l| l[:rel] == rel}.should be_true
        end

        it "has a href for #{rel} relation" do
          link = subject[:link].find {|l| l[:rel] == rel}
          link[:href].should =~ %r{/customers/123/#{rel}}
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rest_model-0.1.13 spec/integration/has_many_spec.rb
rest_model-0.1.12 spec/integration/has_many_spec.rb
rest_model-0.1.11 spec/integration/has_many_spec.rb
rest_model-0.1.10 spec/integration/has_many_spec.rb
rest_model-0.1.9 spec/integration/has_many_spec.rb
rest_model-0.1.8 spec/integration/has_many_spec.rb
rest_model-0.1.7 spec/integration/has_many_spec.rb
rest_model-0.1.6 spec/integration/has_many_spec.rb
rest_model-0.1.5 spec/integration/has_many_spec.rb
rest_model-0.1.4 spec/integration/has_many_spec.rb
rest_model-0.1.3 spec/integration/has_many_spec.rb
rest_model-0.1.2 spec/integration/has_many_spec.rb