2013-02-05 14:16:51 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe NotificationsController do
|
|
|
|
|
|
|
|
context 'when logged in' do
|
|
|
|
let!(:user) { log_in }
|
|
|
|
|
2013-02-25 11:42:20 -05:00
|
|
|
before do
|
2013-02-05 14:16:51 -05:00
|
|
|
xhr :get, :index
|
|
|
|
end
|
|
|
|
|
|
|
|
subject { response }
|
|
|
|
it { should be_success }
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when not logged in' do
|
|
|
|
it 'should raise an error' do
|
|
|
|
lambda { xhr :get, :index }.should raise_error(Discourse::NotLoggedIn)
|
2013-02-25 11:42:20 -05:00
|
|
|
end
|
2013-02-05 14:16:51 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|