Sha256: 94fd4f3ca084f5e8b19b816e0acb4c735eb3a8e1c5f09ae4caa07fed22ec552c

Contents?: true

Size: 672 Bytes

Versions: 1

Compression:

Stored size: 672 Bytes

Contents

require 'spec_helper'

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

      describe "#namespace" do
        it "calls Namespaces::Base test! method with correct params" do
          namespace_instance = Namespaces::Base.new
          namespace_instance.stub(:test!).and_return("tested!")

          Namespaces::Base.should_receive(:new).
                           with(:admin, option: 1).
                           exactly(1).times.
                           and_return(namespace_instance)

          subject.namespace(:admin, option: 1).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/namespaces/method_spec.rb