Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
60c1c16
commit 24a34be
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--color | ||
--format documentation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require 'spec_helper' | ||
|
||
describe AutoExpreso::Client do | ||
let(:auto) { AutoExpreso::Client.new } | ||
|
||
describe '#client' do | ||
it 'returns a new Mechanize instance' do | ||
expect(auto.client).to be_kind_of(Mechanize) | ||
end | ||
end | ||
|
||
describe '#account' do | ||
it 'returns a Hash' do | ||
expect(auto.account).to be_a(Hash) | ||
end | ||
end | ||
|
||
describe '#transactions' do | ||
it 'returns an array' do | ||
expect(auto.transactions).to be_a(Array) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
require 'spec_helper' | ||
|
||
describe AutoExpreso::DataUtils do | ||
let(:data_utils) { AutoExpreso::DataUtils } | ||
|
||
describe '#attributes' do | ||
it 'returns an array of symbols' do | ||
expect(data_utils.attributes) | ||
.to match_array [:account_name_id, :account_balance_id, :account_status_id,:account_last_payment_id, :account_last_payment_date_id] | ||
end | ||
end | ||
|
||
describe '#form_data' do | ||
it 'returns an OpenStruct instance' do | ||
expect(data_utils.form_data).to be_a(OpenStruct) | ||
end | ||
|
||
it 'contains methods' do | ||
expect(data_utils.form_data.methods(false)) | ||
.to match_array [:login_form_id, :login_form_id=, :login_form_username_name, :login_form_username_name=, :login_form_password_name, :login_form_password_name=, :account_name_id, :account_name_id=, :account_balance_id, :account_balance_id=, :account_status_id, :account_status_id=, :account_last_payment_id, :account_last_payment_id=, :account_last_payment_date_id, :account_last_payment_date_id=, :account_transaction_table_id, :account_transaction_table_id=] | ||
end | ||
|
||
it 'returns html attributes correctly' do | ||
expect(data_utils.form_data.login_form_id).to eq('aspnetForm') | ||
expect(data_utils.form_data.login_form_username_name).to eq('ctl00$ContentPlaceHolder1$Login1$uxUserNameField') | ||
expect(data_utils.form_data.login_form_password_name).to eq('ctl00$ContentPlaceHolder1$Login1$uxPasswordField') | ||
expect(data_utils.form_data.account_name_id).to eq('#ctl00_Content_uxLogonAccountName') | ||
expect(data_utils.form_data.account_balance_id).to eq('#ctl00_Content_uxLogonBalanceAmount') | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require 'autoexpreso' | ||
|
||
RSpec.configure do |config| | ||
config.treat_symbols_as_metadata_keys_with_true_values = true | ||
config.run_all_when_everything_filtered = true | ||
config.filter_run :focus | ||
config.order = 'random' | ||
end |