Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
also test if not in a room
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Nicklas committed Jun 17, 2015
1 parent e210b85 commit b138ae6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions spec/lita/rspec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ def message(response)
end

def channel(response)
response.reply(response.message.source.room_object.id)
response.reply(response.message.source.room_object.name)
if (room = response.message.source.room_object)
response.reply(room.id)
response.reply(room.name)
else
response.reply("No room")
end
end

def command(response)
Expand Down Expand Up @@ -112,6 +116,10 @@ def self.name
send_message("channel", from: room)
expect(replies).to eq(%w(1 Room))
end
it "replies with no channel if not sent from room" do
send_message("channel")
expect(replies).to eq(["No room"])
end
end

describe "#command" do
Expand Down

0 comments on commit b138ae6

Please sign in to comment.