spec/boty/slack/im_spec.rb in boty-0.1.0 vs spec/boty/slack/im_spec.rb in boty-0.1.1

- old
+ new

@@ -6,23 +6,23 @@ subject(:im) { described_class.new } let(:action) { :open } let(:im_url) { - "https://slack.com/api/im.#{action}?"+ - "token=#{ENV['SLACK_BOT_API_TOKEN']}" + "https://slack.com/api/im.#{action}?" \ + "token=#{ENV['SLACK_BOT_API_TOKEN']}" } describe "#open" do it "calls Slack::URL get with token and user" do expect(Slack::URL).to receive(:get).with(im_url + "&user=U1234") im.open "U1234" end it "returns a channel object with the im channel information" do - expect(Slack::URL).to receive(:get).with(im_url + "&user=U1234"). - and_return( + expect(Slack::URL).to receive(:get).with(im_url + "&user=U1234") + .and_return( "ok" => true, "channel" => { "id" => "D024BFF1M" } ) expect(im.open("U1234").id).to eq "D024BFF1M"