moved helper spec to correct file
This commit is contained in:
parent
c9523d49ac
commit
55efeb5a97
2 changed files with 37 additions and 34 deletions
|
|
@ -20,38 +20,4 @@ describe CommentsHelper do
|
|||
(time*1000).should < 1
|
||||
end
|
||||
end
|
||||
|
||||
describe 'commenting_disabled?' do
|
||||
include Devise::TestHelpers
|
||||
before do
|
||||
sign_in alice
|
||||
def user_signed_in?
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
it 'returns true if no user is signed in' do
|
||||
def user_signed_in?
|
||||
false
|
||||
end
|
||||
commenting_disabled?(stub).should == true
|
||||
end
|
||||
|
||||
it 'returns true if @commenting_disabled is set' do
|
||||
@commenting_disabled = true
|
||||
commenting_disabled?(stub).should == true
|
||||
@commenting_disabled = false
|
||||
commenting_disabled?(stub).should == false
|
||||
end
|
||||
|
||||
it 'returns @stream.can_comment? if @stream is set' do
|
||||
post = stub
|
||||
@stream = stub
|
||||
@stream.should_receive(:can_comment?).with(post).and_return(true)
|
||||
commenting_disabled?(post).should == false
|
||||
|
||||
@stream.should_receive(:can_comment?).with(post).and_return(false)
|
||||
commenting_disabled?(post).should == true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
37
spec/helpers/interim_stream_hackiness_helper_spec.rb
Normal file
37
spec/helpers/interim_stream_hackiness_helper_spec.rb
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe InterimStreamHackinessHelper do
|
||||
describe 'commenting_disabled?' do
|
||||
include Devise::TestHelpers
|
||||
before do
|
||||
sign_in alice
|
||||
def user_signed_in?
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
it 'returns true if no user is signed in' do
|
||||
def user_signed_in?
|
||||
false
|
||||
end
|
||||
commenting_disabled?(stub).should == true
|
||||
end
|
||||
|
||||
it 'returns true if @commenting_disabled is set' do
|
||||
@commenting_disabled = true
|
||||
commenting_disabled?(stub).should == true
|
||||
@commenting_disabled = false
|
||||
commenting_disabled?(stub).should == false
|
||||
end
|
||||
|
||||
it 'returns @stream.can_comment? if @stream is set' do
|
||||
post = stub
|
||||
@stream = stub
|
||||
@stream.should_receive(:can_comment?).with(post).and_return(true)
|
||||
commenting_disabled?(post).should == false
|
||||
|
||||
@stream.should_receive(:can_comment?).with(post).and_return(false)
|
||||
commenting_disabled?(post).should == true
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in a new issue