2013-04-04 12:59:44 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2014-09-24 14:45:35 -04:00
|
|
|
describe Admin::SiteTextController do
|
2013-04-04 12:59:44 -04:00
|
|
|
|
|
|
|
it "is a subclass of AdminController" do
|
2014-09-25 11:44:48 -04:00
|
|
|
(Admin::SiteTextController < Admin::AdminController).should == true
|
2013-04-04 12:59:44 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'while logged in as an admin' do
|
|
|
|
before do
|
|
|
|
@user = log_in(:admin)
|
|
|
|
end
|
|
|
|
|
|
|
|
context '.show' do
|
2014-09-24 14:45:35 -04:00
|
|
|
let(:text_type) { SiteText.text_types.first.text_type }
|
2013-04-04 12:59:44 -04:00
|
|
|
|
|
|
|
it 'returns success' do
|
2014-09-24 14:45:35 -04:00
|
|
|
xhr :get, :show, id: text_type
|
2013-04-04 12:59:44 -04:00
|
|
|
response.should be_success
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'returns JSON' do
|
2014-09-24 14:45:35 -04:00
|
|
|
xhr :get, :show, id: text_type
|
2013-04-04 12:59:44 -04:00
|
|
|
::JSON.parse(response.body).should be_present
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|