Sha256: 966b307c07b846fa4fb8c8c7296d5f0538e372cdf904cd7a8de590ca48776f62

Contents?: true

Size: 545 Bytes

Versions: 12

Compression:

Stored size: 545 Bytes

Contents

shared_examples_for "listing attributes in the api template" do

  before(:each) do
    @response = @luke.as_api_response(:name_only)
  end

  it "returns a hash" do
    @response.should be_kind_of(Hash)
  end

  it "returns the correct number of fields" do
    @response.should have(2).keys
  end

  it "returns the specified fields only" do
    @response.keys.should include(:first_name, :last_name)
  end

  it "the specified fields have the correct value" do
    @response.values.should include(@luke.first_name, @luke.last_name)
  end

end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
acts_as_api-0.4.4 spec/support/model_examples/simple.rb
acts_as_api-0.4.3 spec/support/model_examples/simple.rb
acts_as_api_sequel-0.0.1 spec/support/model_examples/simple.rb
acts_as_api-0.4.2 spec/support/model_examples/simple.rb
acts_as_api-0.4.1 spec/support/model_examples/simple.rb
acts_as_api-0.4 spec/support/model_examples/simple.rb
acts_as_api-0.3.11 spec/support/model_examples/simple.rb
acts_as_api-0.3.10 spec/support/model_examples/simple.rb
acts_as_api-0.3.9 spec/support/model_examples/simple.rb
acts_as_api-0.3.8 spec/support/model_examples/simple.rb
acts_as_api-0.3.7 spec/support/model_examples/simple.rb
acts_as_api-0.3.6 spec/support/model_examples/simple.rb