2013-02-05 13:16:51 -06:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe StaticController do
|
|
|
|
|
|
|
|
context "with a static file that's present" do
|
|
|
|
|
|
|
|
before do
|
2013-03-23 10:02:59 -05:00
|
|
|
xhr :get, :show, id: 'faq'
|
2013-02-05 13:16:51 -06:00
|
|
|
end
|
|
|
|
|
2013-02-25 10:42:20 -06:00
|
|
|
it 'renders the static file if present' do
|
2013-02-05 13:16:51 -06:00
|
|
|
response.should be_success
|
|
|
|
end
|
|
|
|
|
|
|
|
it "renders the file" do
|
|
|
|
response.should render_template('faq')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "with a missing file" do
|
|
|
|
it "should respond 404" do
|
2013-03-23 10:02:59 -05:00
|
|
|
xhr :get, :show, id: 'does-not-exist'
|
2013-02-05 13:16:51 -06:00
|
|
|
response.response_code.should == 404
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|