You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

slack_client_spec.rb 738B

123456789101112131415161718192021222324
  1. require "dotenv/load"
  2. require "slack_mattermost_emoji/slack_client"
  3. RSpec.describe SlackMattermostEmoji::SlackClient do
  4. it 'should be able to log in to slack using the provided credentials' do
  5. client = SlackMattermostEmoji::SlackClient.new(
  6. username: ENV['SLACK_USERNAME'],
  7. password: ENV['SLACK_PASSWORD'],
  8. domain: ENV['SLACK_DOMAIN']
  9. )
  10. client.authenticate
  11. expect(client.authenticated?).to be true
  12. end
  13. it 'should handle a bad credentials error' do
  14. client = SlackMattermostEmoji::SlackClient.new(
  15. username: ENV['SLACK_USERNAME'],
  16. password: 'wrongpassword',
  17. domain: ENV['SLACK_DOMAIN']
  18. )
  19. expect { client.authenticate }.to raise_error('Invalid credentials')
  20. end
  21. end