mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
28 lines
539 B
Ruby
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
|
|
|