Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 24 lines (18 sloc) 0.633 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
$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
Something went wrong with that request. Please try again.