Sha256: 5894d84367bc42555950388dfc653e1f6c95e912ea59e88814b917b479f12dfd

Contents?: true

Size: 676 Bytes

Versions: 1

Compression:

Stored size: 676 Bytes

Contents

require 'spec_helper'

module ShouldaRouting
  module Resources
    describe Method do
      subject { Class.new.extend described_class }

      describe "#resources" do
        it "calls Resources::Base test! method with correct params" do
          resource_instance = Resources::Base.new
          resource_instance.stub(:test!).and_return("tested!")

          Resources::Base.should_receive(:new).
                          with(:users, except: :destroy).
                          exactly(1).times.
                          and_return(resource_instance)

          subject.resources(:users, except: :destroy).should eq "tested!"
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shoulda_routing-0.0.2 spec/shoulda_routing/resources/method_spec.rb