Sha256: baf10c0060af4df84dcca2567c10d7c287c56c5c15b9bf3ab35f26dbf42d4438

Contents?: true

Size: 635 Bytes

Versions: 24

Compression:

Stored size: 635 Bytes

Contents

require 'spec_helper'

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

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
rest_model-0.1.0 spec/integration/has_many_spec.rb
transcriber-0.0.26 spec/integration/has_many_spec.rb
transcriber-0.0.25 spec/integration/has_many_spec.rb
transcriber-0.0.24 spec/integration/has_many_spec.rb
transcriber-0.0.23 spec/integration/has_many_spec.rb
transcriber-0.0.22 spec/integration/has_many_spec.rb
transcriber-0.0.21 spec/integration/has_many_spec.rb
transcriber-0.0.20 spec/integration/has_many_spec.rb
transcriber-0.0.19 spec/integration/has_many_spec.rb
transcriber-0.0.18 spec/integration/has_many_spec.rb
transcriber-0.0.17 spec/integration/has_many_spec.rb
transcriber-0.0.16 spec/integration/has_many_spec.rb
transcriber-0.0.15 spec/integration/has_many_spec.rb
transcriber-0.0.14 spec/integration/has_many_spec.rb
transcriber-0.0.13 spec/integration/has_many_spec.rb
transcriber-0.0.12 spec/integration/has_many_spec.rb
transcriber-0.0.11 spec/integration/has_many_spec.rb
transcriber-0.0.10 spec/integration/has_many_spec.rb
transcriber-0.0.9 spec/integration/has_many_spec.rb
transcriber-0.0.8 spec/integration/has_many_spec.rb