mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-25 00:29:30 -05:00
7d9a84b496
who don't have avatars.
32 lines
749 B
Ruby
32 lines
749 B
Ruby
require 'spec_helper'
|
|
|
|
describe ComposerMessagesController do
|
|
|
|
context '.index' do
|
|
|
|
it 'requires you to be logged in' do
|
|
lambda { xhr :get, :index }.should raise_error(Discourse::NotLoggedIn)
|
|
end
|
|
|
|
context 'when logged in' do
|
|
let!(:user) { log_in }
|
|
let(:args) { {'topic_id' => '123', 'post_id' => '333', 'composerAction' => 'reply'} }
|
|
|
|
it 'redirects to your user preferences' do
|
|
xhr :get, :index
|
|
response.should be_success
|
|
end
|
|
|
|
it 'delegates args to the finder' do
|
|
finder = mock
|
|
ComposerMessagesFinder.expects(:new).with(instance_of(User), has_entries(args)).returns(finder)
|
|
finder.expects(:find)
|
|
xhr :get, :index, args
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|