A Slack Bot that pulls Pixiv information and posts the full image(s) into Slack, with iOS shortcuts.
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.
 

32 lines
895 B

require 'spec_helper'
describe SlackMathbot::App do
subject do
SlackMathbot::App.new
end
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
it 'succeeds auth' do
expect(subject.config.url).to eq 'https://math.slack.com/'
expect(subject.config.team).to eq 'calcteam'
expect(subject.config.user).to eq 'calcuser'
expect(subject.config.team_id).to eq 'TDEADBEEF'
expect(subject.config.user_id).to eq 'UBAADFOOD'
end
end
end
end