Skip to content

Commit

Permalink
ok, back to replies because we'll need to have auto-follow for direct…
Browse files Browse the repository at this point in the history
… messages
  • Loading branch information
Sven Fuchs committed Mar 28, 2010
1 parent 5da7daf commit 7d38677
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app.rb
Expand Up @@ -29,6 +29,6 @@

get '/ping' do
protected!
poller = Identity::Poller::Twitter.new(:message, ENV['twitter_login'], ENV['twitter_password'])
poller = Identity::Poller::Twitter.new(:reply, ENV['twitter_login'], ENV['twitter_password'])
poller.run!
end
2 changes: 1 addition & 1 deletion lib/identity/poller/twitter.rb
Expand Up @@ -16,7 +16,7 @@ def initialize(type, login, password)
end

def handler(receiver)
Twibot::Handler.new('!([\w]+)') do |message, *args|
Twibot::Handler.new(Identity::Message::COMMAND_PATTERN) do |message, *args|
Identity::Command.queue(receiver,
:receiver => receiver,
:message_id => message.id,
Expand Down
6 changes: 3 additions & 3 deletions test/app_test.rb
Expand Up @@ -22,14 +22,14 @@ def setup

test '/ping is runs a twitter poller' do
Identity::Message.stubs(:max_message_id).returns(12345)
poller = Identity::Poller::Twitter.new(:message, 'login', 'password')
poller = Identity::Poller::Twitter.new(:reply, 'login', 'password')
Identity::Poller::Twitter.stubs(:new).returns(poller)
poller.twitter.expects(:messages).with(:received, :since_id => 12345).returns([twitter_status('svenfuchs', '!update')])
poller.twitter.expects(:timeline_for).with(:replies, :since_id => 12345).returns([twitter_status('svenfuchs', '!update')])

log = capture_stdout { authorized_get '/ping' }

assert_match /imposing as @login/, log
assert_match /Received 1 message/, log
assert_match /Received 1 reply/, log
end

test '/ responding to :html' do
Expand Down

0 comments on commit 7d38677

Please sign in to comment.