Working on devise mocking in helper specs
This commit is contained in:
parent
a46212ec09
commit
6449d20687
1 changed files with 1 additions and 3 deletions
|
|
@ -1,12 +1,11 @@
|
||||||
require File.dirname(__FILE__) + '/../spec_helper'
|
require File.dirname(__FILE__) + '/../spec_helper'
|
||||||
|
|
||||||
include ApplicationHelper
|
include ApplicationHelper
|
||||||
|
|
||||||
describe ApplicationHelper do
|
describe ApplicationHelper do
|
||||||
before do
|
before do
|
||||||
@user = Factory.create(:user)
|
@user = Factory.create(:user)
|
||||||
@person = Factory.create(:person)
|
@person = Factory.create(:person)
|
||||||
request.env['warden'] = mock_model(Warden, :authenticate? => @user, :authenticate! => @user, :authenticate => @user)
|
#env['warden'] = mock_model(Warden, :authenticate? => @user, :authenticate! => @user, :authenticate => @user)
|
||||||
sign_in @user
|
sign_in @user
|
||||||
@user.save
|
@user.save
|
||||||
end
|
end
|
||||||
|
|
@ -17,7 +16,6 @@ describe ApplicationHelper do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should specifiy if a post is owned current user" do
|
it "should specifiy if a post is owned current user" do
|
||||||
ApplicatonHelper.any_instance.stub!(:current_user).and_return(@user)
|
|
||||||
p = Factory.create(:post, :person => @user.person)
|
p = Factory.create(:post, :person => @user.person)
|
||||||
|
|
||||||
puts p.person.id == @user.person.id
|
puts p.person.id == @user.person.id
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue