2012-03-04 21:44:04 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe HomeController do
|
|
|
|
|
|
|
|
describe "GET 'show'" do
|
2012-04-07 09:13:43 +00:00
|
|
|
describe 'when there is at least one featured cast' do
|
|
|
|
before do
|
2012-12-01 17:45:06 +00:00
|
|
|
FactoryGirl.create(:asciicast, :featured => true)
|
2012-04-07 09:13:43 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it "returns http success" do
|
|
|
|
get 'show'
|
|
|
|
response.should be_success
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'when there is no featured cast but any cast exists' do
|
|
|
|
before do
|
2012-12-01 17:45:06 +00:00
|
|
|
FactoryGirl.create(:asciicast, :featured => false)
|
2012-04-07 09:13:43 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it "returns http success" do
|
|
|
|
get 'show'
|
|
|
|
response.should be_success
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'when there are no casts at all' do
|
|
|
|
it "returns http success" do
|
|
|
|
get 'show'
|
|
|
|
response.should be_success
|
|
|
|
end
|
2012-03-04 21:44:04 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|