discourse/spec/controllers/queued_posts_controller_spec.rb
2015-04-15 14:54:37 -04:00

28 lines
539 B
Ruby

require 'spec_helper'
describe QueuedPostsController do
context 'without authentication' do
it 'fails' do
xhr :get, :index
expect(response).not_to be_success
end
end
context 'as a regular user' do
let!(:user) { log_in(:user) }
it 'fails' do
xhr :get, :index
expect(response).not_to be_success
end
end
context 'as an admin' do
let!(:user) { log_in(:moderator) }
it 'returns the queued posts' do
xhr :get, :index
expect(response).to be_success
end
end
end