Browse Source

Test raising for missing credentials

master
Dylan Baker 4 years ago
parent
commit
dc0dfbe357
1 changed files with 10 additions and 0 deletions
  1. 10
    0
      spec/slack_client_spec.rb

+ 10
- 0
spec/slack_client_spec.rb View File

@@ -2,6 +2,16 @@ require "dotenv/load"
2 2
 require "slack_mattermost_emoji/slack_client"
3 3
 
4 4
 RSpec.describe SlackMattermostEmoji::SlackClient do
5
+  it 'should raise if credentials are missing' do
6
+    expect do
7
+       SlackMattermostEmoji::SlackClient.new(
8
+        username: '',
9
+        password: '',
10
+        domain: '',
11
+      )
12
+    end.to raise_error('Slack username, password, and domain are all required')
13
+  end
14
+
5 15
   it 'should be able to log in to slack using the provided credentials' do
6 16
     client = SlackMattermostEmoji::SlackClient.new(
7 17
       username: ENV['SLACK_USERNAME'],

Loading…
Cancel
Save