Sha256: 34058587929ef8b4e1424d3497faecc4b0b4d3fca9ab1c79230fed3ff42d11c6

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

describe Socialcast::CommandLine::Authenticate do
  let(:options) { { :domain => "test.socialcast.local" } }
  let(:params) { {  } }
  subject { Socialcast::CommandLine::Authenticate.new(authenticate_type, options, params) }

  describe '#request' do
    before do
      RestClient::Resource.should_receive(:new).with(url, {}).and_call_original
      RestClient::Resource.any_instance.should_receive(:post).with(subject.params, :accept => :json)
      subject.request
    end
    context 'for a regular user' do
      let(:authenticate_type) { :user }
      let(:url) { "https://test.socialcast.local/api/authentication" }
      # See expectations
      it 'hits the API to try authentication for a regular user' do end
    end

    context 'for an external system' do
      let(:url) { "https://test.socialcast.local/api/external_systems/authentication" }
      let(:authenticate_type) { :external_system }
      # See expectations
      it 'hits the API to try authentication for an external system' do end
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
socialcast-1.3.7 spec/socialcast/command_line/authenticate_spec.rb