spec/rest/sessions_spec.rb in finapps-3.0.5 vs spec/rest/sessions_spec.rb in finapps-3.0.6
- old
+ new
@@ -2,13 +2,13 @@
require 'spec_helpers/client'
RSpec.describe FinApps::REST::Sessions, 'initialized with valid FinApps::Client object' do
include SpecHelpers::Client
+ subject { FinApps::REST::Sessions.new(client) }
describe '#create' do
- subject { FinApps::REST::Sessions.new(client) }
let(:create) { subject.create(credentials) }
let(:results) { create[0] }
let(:error_messages) { create[1] }
context 'when missing email or password' do
@@ -47,7 +47,17 @@
it('results is a Hashie::Rash') { expect(results).to be_a(Hashie::Mash::Rash) }
it('token value is in the result') { expect(results).to respond_to(:token) }
it('returns operator for operator path') { expect(results).to respond_to(:role) }
it('error_messages is empty') { expect(error_messages).to be_empty }
end
+ end
+
+ describe '#destroy' do
+ let(:destroy) { subject.destroy }
+ let(:results) { destroy[0] }
+ let(:error_messages) { destroy[1] }
+
+ it { expect { destroy }.not_to raise_error }
+ it('results is nil') { expect(results).to be_nil }
+ it('error_messages array is empty') { expect(error_messages).to eq([]) }
end
end