rosa-build/spec/controllers/api/v1/arches_controller_spec.rb

31 lines
711 B
Ruby
Raw Normal View History

require 'spec_helper'
describe Api::V1::ArchesController do
before { FactoryGirl.create(:arch) }
context 'for guest' do
it "should be able to perform index action", :anonymous_access => true do
2014-01-21 04:51:49 +00:00
get :index, format: :json
should render_template(:index)
end
it 'should be able to perform get_id action', :anonymous_access => false do
2014-01-21 04:51:49 +00:00
get :index, format: :json
response.status.should == 401
end
end
context 'for simple user' do
before do
stub_symlink_methods
http_login(FactoryGirl.create(:user))
end
it "should be able to perform index action" do
2014-01-21 04:51:49 +00:00
get :index, format: :json
should render_template(:index)
end
end
end