Sha256: 33449ccdfac75ba3dac2c367c85282706e87353f105c5c54f1ba49d3ff8e4605

Contents?: true

Size: 724 Bytes

Versions: 27

Compression:

Stored size: 724 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'spec_helper'))

describe Castronaut::Models::Dispenser do
  module Foo
    module Bar
      
      class FakeModel
        include Castronaut::Models::Dispenser
    
        attr_accessor :ticket
    
        def ticket_prefix
          "WOO!"
        end
    
        def write_attribute(attr, value)
          instance_variable_set "@#{attr}", value
        end
      end
      
    end
  end
  
  it "generates the ticket using the classes ticket prefix and a random string" do
    Castronaut::Utilities::RandomString.stub!(:generate).and_return("RANDOM")
    
    Foo::Bar::FakeModel.new.send(:dispense_ticket).should == "WOO!-RANDOM"
  end
  
end

Version data entries

27 entries across 27 versions & 6 rubygems

Version Path
3mix-castronaut-0.5.0.2 spec/castronaut/models/dispenser_spec.rb
masover-castronaut-0.4.4.4 spec/castronaut/models/dispenser_spec.rb
masover-castronaut-0.4.4.5 spec/castronaut/models/dispenser_spec.rb
masover-castronaut-0.5.0.1 spec/castronaut/models/dispenser_spec.rb
p8-castronaut-0.6.1.1 spec/castronaut/models/dispenser_spec.rb
relevance-castronaut-0.2.0 spec/castronaut/models/dispenser_spec.rb
relevance-castronaut-0.2.5 spec/castronaut/models/dispenser_spec.rb
relevance-castronaut-0.3.0 spec/castronaut/models/dispenser_spec.rb
relevance-castronaut-0.3.5 spec/castronaut/models/dispenser_spec.rb
relevance-castronaut-0.3.6 spec/castronaut/models/dispenser_spec.rb
relevance-castronaut-0.4.1 spec/castronaut/models/dispenser_spec.rb
relevance-castronaut-0.4.2 spec/castronaut/models/dispenser_spec.rb
relevance-castronaut-0.4.3 spec/castronaut/models/dispenser_spec.rb
relevance-castronaut-0.4.4 spec/castronaut/models/dispenser_spec.rb
relevance-castronaut-0.4.5 spec/castronaut/models/dispenser_spec.rb
relevance-castronaut-0.4.6 spec/castronaut/models/dispenser_spec.rb
relevance-castronaut-0.5.0 spec/castronaut/models/dispenser_spec.rb
relevance-castronaut-0.5.1 spec/castronaut/models/dispenser_spec.rb
relevance-castronaut-0.5.2 spec/castronaut/models/dispenser_spec.rb
relevance-castronaut-0.5.3 spec/castronaut/models/dispenser_spec.rb