Commit 2489c32b authored by Sergey Gernyak's avatar Sergey Gernyak

Account and AccountSession implementation

parent 8957ca73
......@@ -6,6 +6,11 @@ require 'redis'
require 'active_support/dependencies/autoload'
module BetfairApiNgRails
extend ActiveSupport::Autoload
autoload :Account
autoload :AccountSession
module Api
extend ActiveSupport::Autoload
......
module BetfairApiNgRails
class Account < Struct.new(:username, :password, :app_key)
end
end
module BetfairApiNgRails
class AccountSession < Struct.new(:username, :ssoid)
end
end
require 'spec_helper'
describe BetfairApiNgRails::AccountSession do
let(:username) { 'user001' }
let(:ssoid) { 'wgj34g8h39p4hgp3j' }
let(:opts) { [username, ssoid] }
subject(:account_session) { described_class.new(*opts) }
its(:username) { is_expected.to eq username }
its(:ssoid) { is_expected.to eq ssoid }
end
require 'spec_helper'
describe BetfairApiNgRails::Account do
let(:username) { 'user001' }
let(:password) { 'some_password' }
let(:app_key) { 'n34f73o48fn' }
let(:opts) { [username, password, app_key] }
subject(:account) { described_class.new(*opts) }
its(:username) { is_expected.to eq username }
its(:password) { is_expected.to eq password }
its(:app_key) { is_expected.to eq app_key }
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment