Sha256: b80b1c6b8b84f7d79f63015f82038b3087079fa3b3401ef55bb6f370a79e8b7a

Contents?: true

Size: 633 Bytes

Versions: 7

Compression:

Stored size: 633 Bytes

Contents

$LOAD_PATH << File.dirname(__FILE__)
require 'spec_helper'
require 'datamapper4rails/datamapper_store'

describe ActionController::Session::DatamapperStore do

  def mock_session(stubs={})
    @mock_session ||= mock(Session, stubs)
  end
  
  before :each do
    @store = ActionController::Session::DatamapperStore.new(nil, :session_class => Session)
  end
  
  it 'should create a new session' do
    Session.should_receive(:create).and_return(mock_session)
    mock_session.should_receive(:data).and_return({})
    result = @store.send(:get_session, {}, nil)
    result[0].should_not be_nil
    result[1].should == {}
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
datamapper4rails-0.5.2 spec/datamapper_store_spec.rb
datamapper4rails-0.5.1 spec/datamapper_store_spec.rb
datamapper4rails-0.5.0 spec/datamapper_store_spec.rb
datamapper4rails-0.4.0 spec/datamapper_store_spec.rb
datamapper4rails-0.3.2 spec/datamapper_store_spec.rb
datamapper4rails-0.3.1 spec/datamapper_store_spec.rb
datamapper4rails-0.3.0 spec/datamapper_store_spec.rb