Sha256: a2f4991c981c2f7e8a6bc8db38eecf0c1ab4c78f38a70055e7ed659b07160d43

Contents?: true

Size: 560 Bytes

Versions: 18

Compression:

Stored size: 560 Bytes

Contents

require 'spec_helper'

describe Amfetamine::RestHelpers do
  context "methods" do

    it "plural_path" do
      Dummy.rest_path.should ==('/dummies')
    end

    it "singular_path" do
      dummy = build(:dummy)
      dummy.singular_path.should ==("/dummies/#{dummy.id}")
    end

    it "find_path" do
      dummy = build(:dummy)
      Dummy.find_path(dummy.id).should ==("/dummies/#{dummy.id}")
    end

    it "should work with a resource suffix" do
      Dummy.resource_suffix = '.json'
      Dummy.rest_path.should ==('/dummies.json')
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
amfetamine-0.4.2 spec/amfetamine/rest_helpers_spec.rb
amfetamine-0.4.1 spec/amfetamine/rest_helpers_spec.rb
amfetamine-0.4.0 spec/amfetamine/rest_helpers_spec.rb
amfetamine-0.3.3 spec/amfetamine/rest_helpers_spec.rb
amfetamine-0.3.2 spec/amfetamine/rest_helpers_spec.rb
amfetamine-0.3.1 spec/amfetamine/rest_helpers_spec.rb
amfetamine-0.3.0 spec/amfetamine/rest_helpers_spec.rb
amfetamine-0.2.12 spec/amfetamine/rest_helpers_spec.rb
amfetamine-0.2.11 spec/amfetamine/rest_helpers_spec.rb
amfetamine-0.2.9 spec/amfetamine/rest_helpers_spec.rb
amfetamine-0.2.7 spec/amfetamine/rest_helpers_spec.rb
amfetamine-0.2.6 spec/amfetamine/rest_helpers_spec.rb
amfetamine-0.2.5 spec/amfetamine/rest_helpers_spec.rb
amfetamine-0.2.4 spec/amfetamine/rest_helpers_spec.rb
amfetamine-0.2.3 spec/amfetamine/rest_helpers_spec.rb
amfetamine-0.2.1 spec/amfetamine/rest_helpers_spec.rb
amfetamine-0.2.0 spec/amfetamine/rest_helpers_spec.rb
amfetamine-0.1.5 spec/amfetamine/rest_helpers_spec.rb