spec/dataset/session_binding_spec.rb in dataset-1.3.1 vs spec/dataset/session_binding_spec.rb in dataset-1.3.2
- old
+ new
@@ -140,21 +140,26 @@
end
end
describe 'name_model' do
before do
+ @place = Place.create!
+ @binding.name_model(@place, :myplace)
@state = State.create!(:name => 'NC')
@binding.name_model(@state, :mystate)
end
it 'should allow assigning a name to a model for later lookup' do
+ @binding.find_model(Place, :myplace).should == @place
@binding.find_model(State, :mystate).should == @state
end
it 'should allow finding STI' do
@context = Object.new
@context.extend @binding.model_finders
+ @context.places(:myplace).should == @place
@context.places(:mystate).should == @state
+ @context.states(:mystate).should == @state
end
end
describe 'name_to_sym' do
it 'should convert strings to symbols' do
\ No newline at end of file