Sha256: b3e564ca5d9a6d5e93330f385ec00507a5b203780832e9f4fc6677729c8bbf72
Contents?: true
Size: 1.03 KB
Versions: 6
Compression:
Stored size: 1.03 KB
Contents
require_relative '../../spec_helper' describe Core::Commands::Application::VerifyApiToken do is_required :id, :api_token let(:response) { subject.class.run(params) } before do @application = create(:application) end context 'with valid params' do let(:params) { { id: @application.id, api_token: @application.api_token } } it 'is valid' do response.success?.should == true response.result.should == { id: @application.id } end end context 'with invalid :id' do let(:params) { { id: 142857, api_token: @application.api_token }} it 'is forbidden' do response.success?.should == false response.result.should == {} response.status.should == :forbidden end end context 'with invalid :api_token' do let(:params) { { id: @application.id, api_token: 'invalid_token' }} it 'is forbidden' do response.success?.should == false response.result.should == {} response.status.should == :forbidden end end end
Version data entries
6 entries across 6 versions & 1 rubygems