Fix specs for TemplatePicker
This commit is contained in:
parent
ec9c8d7dae
commit
e9977af7b1
1 changed files with 6 additions and 5 deletions
|
|
@ -24,9 +24,9 @@ describe TemplatePicker do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#status_with_photo_backdrop?' do
|
describe '#status_with_photo_backdrop?' do
|
||||||
it 'is true if the post contains a single photo and text' do
|
it 'is false even if the post contains a single photo and text' do
|
||||||
@post_stubs.merge!(:photos => stub(:size => 1))
|
@post_stubs.merge!(:photos => stub(:size => 1))
|
||||||
TemplatePicker.new(post).should be_status_with_photo_backdrop
|
TemplatePicker.new(post).should_not be_status_with_photo_backdrop
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -37,9 +37,9 @@ describe TemplatePicker do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#photo_backdrop?' do
|
describe '#photo_backdrop?' do
|
||||||
it 'is true if the post contains only one photo' do
|
it 'is false even if the post contains only one photo' do
|
||||||
@post_stubs.merge!(:photos => stub(:size => 1))
|
@post_stubs.merge!(:photos => stub(:size => 1))
|
||||||
TemplatePicker.new(post).should be_photo_backdrop
|
TemplatePicker.new(post).should_not be_photo_backdrop
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
@ -51,7 +51,8 @@ describe TemplatePicker do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'factories' do
|
describe 'factories' do
|
||||||
TemplatePicker::TEMPLATES.each do |template|
|
# No photo_backdrop for now.
|
||||||
|
(TemplatePicker::TEMPLATES - ['status_with_photo_backdrop', 'photo_backdrop']).each do |template|
|
||||||
describe "#{template} factory" do
|
describe "#{template} factory" do
|
||||||
it 'works' do
|
it 'works' do
|
||||||
post = FactoryGirl.build(template.to_sym, :author => alice.person)
|
post = FactoryGirl.build(template.to_sym, :author => alice.person)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue