discourse/spec/controllers/queued_posts_controller_spec.rb

29 lines
539 B
Ruby
Raw Normal View History

2015-04-10 16:00:50 -05:00
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