Sha256: 8c3d4c12d0cfee7f37ae03530f4bdc612763a315b29d27b49ac1d1bb02e1afbe

Contents?: true

Size: 895 Bytes

Versions: 9

Compression:

Stored size: 895 Bytes

Contents

shared_examples 'a slack ruby bot' do
  context 'not configured' do
    before do
      @slack_api_token = ENV.delete('SLACK_API_TOKEN')
    end
    after do
      ENV['SLACK_API_TOKEN'] = @slack_api_token
    end
    it 'requires SLACK_API_TOKEN' do
      expect { subject }.to raise_error RuntimeError, "Missing ENV['SLACK_API_TOKEN']."
    end
  end
  context 'configured', vcr: { cassette_name: 'auth_test' } do
    context 'run' do
      before do
        subject.send(:auth!)
      end
      after do
        subject.send(:reset!)
      end
      it 'succeeds auth' do
        expect(subject.config.url).to eq 'https://rubybot.slack.com/'
        expect(subject.config.team).to eq 'team_name'
        expect(subject.config.user).to eq 'user_name'
        expect(subject.config.team_id).to eq 'TDEADBEEF'
        expect(subject.config.user_id).to eq 'UBAADFOOD'
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
slack-ruby-bot-0.4.5 lib/slack-ruby-bot/rspec/support/slack-ruby-bot/it_behaves_like_a_slack_bot.rb
slack-ruby-bot-0.4.4 lib/slack-ruby-bot/rspec/support/slack-ruby-bot/it_behaves_like_a_slack_bot.rb
slack-ruby-bot-0.4.3 lib/slack-ruby-bot/rspec/support/slack-ruby-bot/it_behaves_like_a_slack_bot.rb
slack-ruby-bot-0.4.2 lib/slack-ruby-bot/rspec/support/slack-ruby-bot/it_behaves_like_a_slack_bot.rb
slack-ruby-bot-0.4.1 lib/slack-ruby-bot/rspec/support/slack-ruby-bot/it_behaves_like_a_slack_bot.rb
slack-ruby-bot-0.4.0 lib/slack-ruby-bot/rspec/support/slack-ruby-bot/it_behaves_like_a_slack_bot.rb
slack-ruby-bot-0.3.1 lib/slack-ruby-bot/rspec/support/slack-ruby-bot/it_behaves_like_a_slack_bot.rb
slack-ruby-bot-0.3.0 lib/slack-ruby-bot/rspec/support/slack-ruby-bot/it_behaves_like_a_slack_bot.rb
slack-ruby-bot-0.2.0 lib/slack-ruby-bot/rspec/support/slack-ruby-bot/it_behaves_like_a_slack_bot.rb