spec/lita/message_spec.rb in lita-1.0.0 vs spec/lita/message_spec.rb in lita-1.1.0
- old
+ new
@@ -1,13 +1,9 @@
require "spec_helper"
describe Lita::Message do
- let(:robot) do
- robot = double("Robot")
- allow(robot).to receive(:name).and_return("Lita")
- robot
- end
+ let(:robot) { double("Lita::Robot", name: "Lita", mention_name: "LitaBot") }
subject do
described_class.new(robot, "Hello", "Carl")
end
@@ -42,10 +38,14 @@
end
end
describe "#command?" do
it "is true when the message is addressed to the Robot" do
- subject = described_class.new(robot, "#{robot.name}: hello", "Carl")
+ subject = described_class.new(
+ robot,
+ "#{robot.mention_name}: hello",
+ "Carl"
+ )
expect(subject).to be_a_command
end
it "is false when the message is not addressed to the Robot" do
expect(subject).not_to be_a_command