mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 03:33:58 -06:00
29 lines
539 B
Ruby
29 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
|
||
|
|