repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/movement_spec.rb | spec/models/movement_spec.rb | require 'spec_helper'
describe Movement do
it { should belong_to(:contact) }
it { should belong_to(:project) }
it { should belong_to(:tax) }
before(:each) do
UserSession.user = build :user, id: 10
end
context "#can_null?" do
let(:subject) {
m = Movement.new(amount: 100, state: 'draft')
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/cash_spec.rb | spec/models/cash_spec.rb | require 'spec_helper'
describe Cash do
let(:valid_attributes) do
{ currency: 'BOB', name: 'Caja 1', amount: 1000.0, address: 'First way', phone: '777-12345', email: 'my@mail.com' }
end
before(:each) do
OrganisationSession.organisation = build(:organisation, currency: 'BOB')
end
context 'Created rel... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/organisation_spec.rb | spec/models/organisation_spec.rb | # encoding: utf-8
require 'spec_helper'
#require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe Organisation do
before do
UserSession.user = build :user, id: 1
end
context 'jsonb_accessor' do
it "test set" do
org = Organisation.new(inventory: true, header_css: "red-header")
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/staff_account_spec.rb | spec/models/staff_account_spec.rb | require 'spec_helper'
describe StaffAccount do
let(:attributes) {
{ name: 'Lucas Estrella', currency:'BOB', amount: 1000,
email: 'lucacho@facebook.com', address: 'Samaipata, La Paz',
phone: '555 666 777', mobile: '777 888 999'
}
}
before(:each) do
OrganisationSession.organisation = build... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/tax_spec.rb | spec/models/tax_spec.rb | require 'spec_helper'
describe Tax do
it { should have_many(:accounts) }
it { should validate_uniqueness_of(:name) }
it { should have_valid(:name).when('Tax 1', 'Tax with details') }
it { should_not have_valid(:name).when('', 'T' * 21) }
it { should have_valid(:percentage).when(0, 1.2, 10.2, 100) }
it { ... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/attachment_spec.rb | spec/models/attachment_spec.rb | require 'spec_helper'
describe Attachment do
it { should belong_to(:attachable) }
it { should validate_presence_of(:attachment) }
it { should validate_presence_of(:position) }
it { should validate_numericality_of(:position) }
context 'attachable' do
subject { Attachment.new(attachable_id: 1, attachable... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/project_spec.rb | spec/models/project_spec.rb | require 'spec_helper'
describe Project do
it { should have_many(:accounts) }
it { should have_many(:account_ledgers) }
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/expense_detail_spec.rb | spec/models/expense_detail_spec.rb | require 'spec_helper'
describe ExpenseDetail do
it { should belong_to(:expense) }
it { should belong_to(:item) }
it { should validate_presence_of(:item) }
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/inventory_spec.rb | spec/models/inventory_spec.rb | # encoding: utf-8
require 'spec_helper'
describe Inventory do
it { should belong_to(:updater).class_name('User') }
it { should belong_to(:store) }
it { should belong_to(:store_to).class_name("Store") }
it { should belong_to(:contact) }
it { should belong_to(:creator) }
it { should belong_to(:project) }
i... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/session_spec.rb | spec/models/session_spec.rb | require 'spec_helper'
describe Session do
let(:valid_attributes) {
{email: 'test@mail.com', password: 'DEMO1234'}
}
let(:user) { build :user, id: 77, password: 'DEMO1234' }
let(:organisation) { build :organisation, id: 77, tenant: 'demo' }
it { should validate_presence_of(:email) }
it { should validat... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/organisation_session_spec.rb | spec/models/organisation_session_spec.rb | #require 'spec_helper'
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe OrganisationSession do
let(:organisation) { build :organisation, id: 100 }
before(:each) do
OrganisationSession.organisation = organisation
end
subject{ OrganisationSession }
it "does not allow other obj... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/income_spec.rb | spec/models/income_spec.rb | require 'spec_helper'
describe Income do
let(:organisation) { build :organisation, id: 1, currency: 'BOB' }
let(:contact) { build :contact, id: 10 }
before(:each) do
OrganisationSession.organisation = organisation
Contact.any_instance.stub(save: true)
end
let(:valid_attributes) {
{active: nil, ... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/loan_spec.rb | spec/models/loan_spec.rb | require 'spec_helper'
describe Loan do
it { should have_valid(:total).when(1, 100) }
it { should_not have_valid(:total).when(0, -100) }
it { should validate_presence_of(:date) }
it { should validate_presence_of(:due_date) }
it { should have_valid(:state).when(*Loan::STATES) }
it { should_not have_valid(:st... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/store_spec.rb | spec/models/store_spec.rb | require 'spec_helper'
describe Store do
it { should have_many(:stocks) }
it { should have_many(:inventories) }
it { should validate_presence_of(:name) }
it { should have_valid(:name).when('123', 'Store') }
it { should_not have_valid(:name).when('12', 'St', '') }
it { should have_valid(:address).when('123... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/unit_spec.rb | spec/models/unit_spec.rb | #require 'spec_helper'
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe Unit do
let(:params) {
{:name => "kilogram", :symbol => "kg", :integer => false}
}
before(:each) do
UserSession.user = build :user, id: 10
end
it 'should create an instance' do
Unit.create!(pa... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/currency_spec.rb | spec/models/currency_spec.rb | # encoding: utf-8
require 'spec_helper'
describe Currency do
it "options" do
Currency.options('BOB', 'PEN', 'ARS').should eq([
['BOB Boliviano', 'BOB'],['PEN Nuevo Sol Peruano', 'PEN'], ['ARS Peso Argentino', 'ARS']
])
end
it "!find" do
Currency.find('USD').should eq(Currency.new(CURRENCIES['... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/history_spec.rb | spec/models/history_spec.rb | require 'spec_helper'
describe History do
it { should belong_to(:historiable) }
context 'Cases' do
before(:each) do
UserSession.user = build :user, id: 1
Item.any_instance.stub(unit: build(:unit))
end
it "#create" do
i = create :item, unit_id: 1
i.should be_persisted
i.h... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/stock_spec.rb | spec/models/stock_spec.rb | require 'spec_helper'
describe Stock do
it { should belong_to(:store) }
it { should belong_to(:item) }
it { should belong_to(:user) }
it { should validate_numericality_of(:minimum) }
it { should validate_presence_of(:store) }
it { should validate_presence_of(:store_id) }
it { should validate_presence_of... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/movement_detail_spec.rb | spec/models/movement_detail_spec.rb | require 'spec_helper'
describe MovementDetail do
it{ should validate_presence_of(:item_id) }
it{ should have_valid(:quantity).when(0.1, 1)}
it{ should_not have_valid(:quantity).when(0)}
it "calculates total and return data_has" do
td = MovementDetail.new(quantity: 2, price: 4, original_price: 4)
td.to... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/income_detail_spec.rb | spec/models/income_detail_spec.rb | require 'spec_helper'
describe IncomeDetail do
it { should belong_to(:income) }
it { should belong_to(:item) }
it { should validate_presence_of(:item) }
let(:income) { Income.new }
context 'Validate correct income_item' do
let(:item) {
build :item, id: 1, for_sale: true, stockable: true, active: ... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/link_spec.rb | spec/models/link_spec.rb | require 'spec_helper'
describe Link do
it { should belong_to(:organisation) }
it { should belong_to(:user) }
it { should validate_presence_of(:role) }
it { should validate_presence_of(:organisation_id) }
context 'scopes' do
it "::org_links" do
sql = Link.org_links(2).to_sql
expect(sql).to m... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/tag_spec.rb | spec/models/tag_spec.rb | require 'spec_helper'
describe Tag do
it { should validate_presence_of(:name) }
it { should validate_uniqueness_of(:name) }
it { should have_valid(:name).when('uno', 'buena cosa', 'niño 1') }
it { should_not have_valid(:name).when('', 'uno!', 'aa', 'uno, a', ' ', 'a' * 21) }
it { should have_valid(:bgcol... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/bank_spec.rb | spec/models/bank_spec.rb | require 'spec_helper'
describe Bank do
let(:valid_attributes) {
{ currency: 'BOB', name: 'Banco Uno 12365498', address: 'Uno', amount: 100, phone: '55-6678', website: 'mind.com' }
}
it "returns to_s" do
b = Bank.new name: 'Banco Central 121-121289'
b.to_s.should eq("Banco Central 121-121289")
end... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/account_spec.rb | spec/models/account_spec.rb | # encoding: utf-8
require 'spec_helper'
describe Account do
it { should belong_to(:updater).class_name('User') }
#
it { should belong_to(:contact) }
it { should have_many(:account_ledgers) }
it { should have_valid(:currency).when('BOB', 'EUR') }
it { should_not have_valid(:currency).when('BOBB', 'UUUU')... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/item_spec.rb | spec/models/item_spec.rb | # encoding: utf-8
# author: Boris Barroso
# email: boriscyber@gmail.com
#require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'spec_helper'
describe Item do
it { should belong_to(:unit) }
it { should have_many(:stocks) }
it { should have_many(:income_details) }
it { should have_many(:ex... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/user_session_spec.rb | spec/models/user_session_spec.rb | # encoding: utf-8
require 'spec_helper'
describe UserSession do
it "sets a user correctly" do
UserSession.user = build :user, id: 12, email: 'user@mail.com'
UserSession.user.should be_is_a(User)
UserSession.id.should eq(12)
UserSession.email.should eq('user@mail.com')
end
it "destroys the user... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/expense_spec.rb | spec/models/expense_spec.rb | require 'spec_helper'
describe Expense do
let(:organisation) { build :organisation, id: 1 }
let(:contact) { build :contact, id: 10 }
before(:each) do
OrganisationSession.organisation = organisation
Contact.any_instance.stub(save: true)
end
let(:valid_attributes) {
{ active: nil, bill_number: "5... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/currency_exchange_spec.rb | spec/models/currency_exchange_spec.rb | # encoding: utf-8
require 'spec_helper'
describe CurrencyExchange do
before do
OrganisationSession.organisation = build(:organisation, currency: 'BOB')
end
let(:account_bob) { build :account, currency: 'BOB' }
let(:account_usd) { build :account, currency: 'USD' }
let(:account_eur) { build :account, curr... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/contact_account_spec.rb | spec/models/contact_account_spec.rb | # encoding: utf-8
require 'spec_helper'
describe ContactAccount do
it "sets a new instance with defaults" do
c = ContactAccount.new
c.type.should eq('ContactAccount')
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/user_spec.rb | spec/models/user_spec.rb | require 'spec_helper'
describe User do
it { should have_many(:links).dependent(:destroy) }
it { should have_many(:active_links).dependent(:destroy) }
it { should have_many(:organisations).through(:active_links) }
let(:valid_attributes)do
{email: 'demo@example.com', password: 'demo1234'}
end
it 'shou... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/user_with_role_spec.rb | spec/models/user_with_role_spec.rb | require 'spec_helper'
describe UserWithRole do
it "expects user" do
expect { UserWithRole.new(nil, nil)}.to raise_error
end
it "expects organisation" do
u = build :user
expect { UserWithRole.new(u, u)}.to raise_error
end
let(:link) { build(:link, master_account: true, role: 'admin') }
let(:or... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/tag_group_spec.rb | spec/models/tag_group_spec.rb | require 'spec_helper'
describe TagGroup do
it { should validate_presence_of(:name) }
it { should ensure_length_of(:name).is_at_least(3) }
it { should ensure_length_of(:name).is_at_most(100) }
let(:tag1) { create :tag, name: 'Tag 1' }
let(:tag2) { create :tag, name: 'Tag 2' }
it "#to_s" do
tg = TagGro... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/inventory_detail_spec.rb | spec/models/inventory_detail_spec.rb | require 'spec_helper'
describe InventoryDetail do
it { should belong_to(:inventory) }
it { should belong_to(:item) }
it { should validate_presence_of(:item) }
it { should validate_presence_of(:item_id) }
it { should have_valid(:quantity).when(0.1, 1, 100) }
it { should_not have_valid(:quantity).when(-0.1... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/account_ledgers/query_spec.rb | spec/models/account_ledgers/query_spec.rb | require 'spec_helper'
describe AccountLedger do
subject { AccountLedgers::Query.new }
it "#money" do
sql = <<-SQL
SELECT "account_ledgers".* FROM "account_ledgers" WHERE ("account_ledgers"."account_id" = 1 OR "account_ledgers"."account_to_id" = 1) ORDER BY account_ledgers.date desc, account_ledgers.id desc
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/inventories/form_spec.rb | spec/models/inventories/form_spec.rb | # encoding: utf-8
require 'spec_helper'
describe Inventories::Form do
let(:store) { build :store, id: 1 }
let(:valid_attributes) {
{store_id: 1}
}
it 'invalid' do
io = Inventories::Form.new(store_id: 1)
io.should_not be_valid
end
it "Valid" do
io = Inventories::Form.new(store_id: 1, inven... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/inventories/transference_spec.rb | spec/models/inventories/transference_spec.rb | # encoding: utf-8
require 'spec_helper'
describe Inventories::Transference do
let(:store) { build :store, id: 1 }
let(:store_to) { build :store, id: 2 }
let(:valid_attributes) {
{store_id: 1, store_to_id: 2,
date: Date.today, description: 'Test transference',
inventory_details_attributes: [
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/inventories/errors_spec.rb | spec/models/inventories/errors_spec.rb | require 'spec_helper'
describe Inventories::Errors do
class StockTest < OpenStruct; end
def get_stocks
[
StockTest.new(quantity: 1, item_id: 1),
StockTest.new(quantity: -1, item_id: 2),
StockTest.new(quantity: -2, item_id: 3)
]
end
let(:inventory) {
Inventory.new(inventory_deta... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/inventories/in_spec.rb | spec/models/inventories/in_spec.rb | # encoding: utf-8
require 'spec_helper'
describe Inventories::In do
let(:store) { build :store, id: 1 }
let(:valid_attributes) {
{store_id: 1, date: Date.today, description: 'Test inventory in',
inventory_details_attributes: [
{item_id: 1, quantity: 2},
{item_id: 2, quantity: 2}
]
}
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/inventories/out_spec.rb | spec/models/inventories/out_spec.rb | # encoding: utf-8
require 'spec_helper'
describe Inventories::Out do
let(:store) { build :store, id: 1 }
let(:valid_attributes) {
{store_id: 1, date: Date.today, description: 'Test inventory out',
inventory_details_attributes: [
{item_id: 1, quantity: 2},
{item_id: 2, quantity: 2}
]
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/expenses/form_spec.rb | spec/models/expenses/form_spec.rb | require 'spec_helper'
# encoding: utf-8
describe Expenses::Form do
let(:details) {
[{item_id: 1, price: 10.0, quantity: 10, description: "First item"},
{item_id: 2, price: 20.0, quantity: 20, description: "Second item"}
]
}
let(:item_ids) { details.map {|v| v[:item_id] } }
let(:total) { 500 }
l... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/expenses/devolution_spec.rb | spec/models/expenses/devolution_spec.rb | # encoding: utf-8
require 'spec_helper'
describe Expenses::Devolution do
let(:valid_attributes) {
{
account_id: 10, account_to_id: 2, exchange_rate: 1,
amount: 50, reference: 'Primera devolucion',
verification: 'true', date: Date.today
}
}
let(:balance) { 100.0 }
let(:total) { balanc... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/expenses/query_spec.rb | spec/models/expenses/query_spec.rb | require 'spec_helper'
describe Expenses::Query do
subject { Expenses::Query.new }
it "Initializes with " do
subject.instance_variable_get(:@rel).to_s.should eq('Expense')
end
it "returns the contacts from the expense for exchanges" do
cid = 10
#subject.exchange(cid).to_sql.should == "SELECT \"acc... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/expenses/inventory_out_spec.rb | spec/models/expenses/inventory_out_spec.rb | # encoding: utf-8
require 'spec_helper'
describe Expenses::InventoryOut do
let(:store) { build :store, id: 1 }
before(:each) do
ExpenseDetail.any_instance.stub(item: build(:item))
Expense.any_instance.stub(contact: build(:contact), set_supplier_and_expenses_status: true)
end
let(:contact) {
cont ... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/expenses/batch_payment_spec.rb | spec/models/expenses/batch_payment_spec.rb | require 'spec_helper'
describe Expenses::BatchPayment do
before(:each) do
UserSession.user = build :user, id: 10
end
let(:cash) { create :cash, amount: 0 }
let(:contact) { create :contact }
it "#make_payments" do
e1 = build(:expense, state: 'approved', balance: 100, contact_id: contact.id)
e2 =... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/expenses/inventory_in_spec.rb | spec/models/expenses/inventory_in_spec.rb | # encoding: utf-8
require 'spec_helper'
describe Expenses::InventoryIn do
let(:store) { build :store, id: 1 }
let(:contact) {
cont = build :contact
cont.stub(save: true)
cont
}
before(:each) do
ExpenseDetail.any_instance.stub(item: build(:item))
Expense.any_instance.stub(contact: contact,... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/expenses/payment_spec.rb | spec/models/expenses/payment_spec.rb | # encoding: utf-8
require 'spec_helper'
describe Expenses::Payment do
before(:each) do
OrganisationSession.organisation = build :organisation, currency: 'BOB'
UserSession.user = build :user, id: 12
end
let(:valid_attributes) {
{
account_id: 10, account_to_id: 2, exchange_rate: 1,
amount:... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/expenses/errors_spec.rb | spec/models/expenses/errors_spec.rb | require 'spec_helper'
describe Expenses::Errors do
subject { Expense.new }
it "initializes an expense without any errors" do
subject.should_not be_has_error
subject.error_messages.should be_blank
end
it "sets error for balance" do
subject.total = 10
subject.balance = -1.1
Expenses::Error... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/accounts/query_spec.rb | spec/models/accounts/query_spec.rb | require 'spec_helper'
describe Accounts::Query do
it "#money" do
active = Account.active
Account.should_receive(:active).and_return(active)
ret = Object.new
ret.should_receive(:order).with(:type, :name)
active.should_receive(:where).with(type: %w(Bank Cash StaffAccount)).and_return(ret)
Ac... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/incomes/form_spec.rb | spec/models/incomes/form_spec.rb | require 'spec_helper'
# encoding: utf-8
describe Incomes::Form do
let(:details) {
[{item_id: 1, price: 10.0, quantity: 10, description: "First item"},
{item_id: 2, price: 20.0, quantity: 20, description: "Second item"}
]
}
let(:item_ids) { details.map {|v| v[:item_id] } }
let(:total) { 500 }
le... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/incomes/export_spec.rb | spec/models/incomes/export_spec.rb | require 'spec_helper'
describe Incomes::Export do
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/incomes/devolution_spec.rb | spec/models/incomes/devolution_spec.rb | # encoding: utf-8
require 'spec_helper'
describe Incomes::Devolution do
let(:today) { Time.zone.now.to_date }
let(:valid_attributes) {
{
account_id: 10, account_to_id: 2, exchange_rate: 1,
amount: 50, reference: 'Primera devolucion',
verification: 'true', date: today
}
}
let(:balance... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/incomes/inventory_out_spec.rb | spec/models/incomes/inventory_out_spec.rb | # encoding: utf-8
require 'spec_helper'
describe Incomes::InventoryOut do
let(:store) { build :store, id: 1 }
let(:item) { build :item, for_sale: true }
let(:store) { build :store }
let(:user) { build :user, id: 10 }
let(:today) { Time.zone.now.to_date }
let(:contact) {
cont = build :contact
cont... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/incomes/batch_payment_spec.rb | spec/models/incomes/batch_payment_spec.rb | require 'spec_helper'
describe Incomes::BatchPayment do
before(:each) do
UserSession.user = build :user, id: 10
end
let(:cash) { create :cash, amount: 0 }
let(:contact) { create :contact }
it "#make_payments" do
i1 = build(:income, state: 'approved', balance: 100, contact_id: contact.id)
i2 = b... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/incomes/inventory_in_spec.rb | spec/models/incomes/inventory_in_spec.rb | # encoding: utf-8
require 'spec_helper'
describe Incomes::InventoryIn do
let(:store) { build :store, id: 1 }
let(:today) { Time.zone.now.to_date }
let(:contact) {
cont = build :contact
cont.stub(save: true)
cont
}
let(:income) {
inc = Income.new(
attributes_for(:income_approved).merg... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/incomes/payment_spec.rb | spec/models/incomes/payment_spec.rb | # encoding: utf-8
require 'spec_helper'
describe Incomes::Payment do
before(:each) do
OrganisationSession.organisation = build :organisation, currency: 'BOB'
UserSession.user = build :user, id: 10
end
let(:valid_attributes) {
{
account_id: 10, account_to_id: 2, exchange_rate: 1,
amount:... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/incomes/errors_spec.rb | spec/models/incomes/errors_spec.rb | require 'spec_helper'
describe Incomes::Errors do
subject { Income.new }
it "initializes an income without any errors" do
subject.should_not be_has_error
subject.error_messages.should be_blank
end
it "sets error for balance" do
subject.total = 10
subject.balance = -1.1
Incomes::Errors.ne... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/loans/receive_payment_form_spec.rb | spec/models/loans/receive_payment_form_spec.rb | require 'spec_helper'
describe Loans::ReceivePaymentForm do
#it { should validate_presence_of(:reference) }
let(:loan_attr) do
today = Date.today
{
date: today, due_date: today + 10.days, total: 100,
reference: 'Receipt 00232', contact_id: 1
}
end
it "validate" do
lp = Loans::Pay... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/loans/form_spec.rb | spec/models/loans/form_spec.rb | require 'spec_helper'
describe Loans::Form do
let(:attributes) do
today = Date.today
{
date: today, due_date: today + 10.days, total: 100,
reference: 'Receipt 00232', contact_id: 1, account_to_id: 1, exchange_rate: 1
}
end
it { should validate_presence_of(:account_to_id) }
it { should ... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/loans/give_payment_form_spec.rb | spec/models/loans/give_payment_form_spec.rb | require 'spec_helper'
describe Loans::GivePaymentForm do
#it { should validate_presence_of(:reference) }
let(:loan_attr) do
today = Date.today
{
date: today, due_date: today + 10.days, total: 100,
reference: 'Receipt 00232', contact_id: 1
}
end
context 'payment' do
let(:cash) { cr... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/loans/give_spec.rb | spec/models/loans/give_spec.rb | require 'spec_helper'
describe Loans::Give do
it { should have_many(:ledger_ins) }
it { should have_many(:payments) }
it { should have_many(:interest_ledgers) }
it "#initialize with code" do
l = Loans::Give.new {}
y = Date.today.year.to_s[2..4]
expect(l.name).to eq("PG-#{y}-0001")
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/loans/receive_form_spec.rb | spec/models/loans/receive_form_spec.rb | require 'spec_helper'
describe Loans::ReceiveForm do
let(:cash) { create :cash, currency: 'BOB', amount: 0 }
let(:attributes) do
today = Date.today
{
date: today, due_date: today + 10.days, total: 100,
reference: 'Receipt 00232', contact_id: 1, description: 'Hi'
}
end
before(:each) do
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/loans/give_form_spec.rb | spec/models/loans/give_form_spec.rb | require 'spec_helper'
describe Loans::GiveForm do
before(:each) do
UserSession.user = build :user, id: 1
end
let(:cash) { create :cash, currency: 'BOB', amount: 0 }
let(:attributes) do
today = Date.today
{
date: today, due_date: today + 10.days, total: 100,
reference: 'Receipt 00232', ... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/loans/ledger_in_form_spec.rb | spec/models/loans/ledger_in_form_spec.rb | require 'spec_helper'
describe Loans::LedgerInForm do
let(:user) { build :user, id: 1 }
let(:contact) { create :contact, matchcode: 'James Brown' }
before(:each) do
UserSession.user = user
end
let(:bank) { create :bank, amount: 1000 }
let(:today) { Date.today }
let(:loan_attributes) {
{
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/loans/payment_form_spec.rb | spec/models/loans/payment_form_spec.rb | require 'spec_helper'
describe Loans::PaymentForm do
it { should validate_presence_of(:date) }
it { should validate_presence_of(:reference) }
it "valid loan" do
l = Loans::PaymentForm.new
l.should be_invalid
l.errors[:account_to].should_not be_blank
l.errors[:loan].should_not be_blank
end
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/loans/receive_spec.rb | spec/models/loans/receive_spec.rb | require 'spec_helper'
describe Loans::Receive do
let(:attributes) {
today = Date.today
{
name: 'P-0001', currency: 'BOB', date: today,
due_date: today + 10.days, total: 100,
account_to_id: 10
}
}
it { should have_many(:ledger_ins) }
it { should have_many(:payments) }
it { shoul... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/movements/form_spec.rb | spec/models/movements/form_spec.rb | require 'spec_helper'
describe Movements::Form do
it "Expense::Form#form_details_data NEW" do
exp = Expenses::Form.new_expense
exp.details.should_not_receive(:includes).with(:item)
exp.form_details_data
end
it "Expense::Form#form_details_data EDIT" do
exp = Expenses::Form.new_expense
exp.mo... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/movements/query_spec.rb | spec/models/movements/query_spec.rb | require 'spec_helper'
describe Movements::Query do
it "#search SQL" do
sql = Movements::Query.new(Income).search('ab').to_sql
expect(sql).to match(/"accounts"."type" IN \('Income'\)/)
expect(sql).to match(/accounts.name ILIKE '%ab%' OR accounts.description ILIKE '%ab%' OR contacts.matchcode ILIKE '%ab%'... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/movements/details_calculations_spec.rb | spec/models/movements/details_calculations_spec.rb | require 'spec_helper'
describe Movements::DetailsCalculations do
subject do
i = Income.new
i.income_details.build(price: 10, quantity: 10, balance: 10, original_price: 10)
i.income_details.build(price: 20, quantity: 5, balance: 5, original_price: 19)
i
end
it "#subtotal" do
m = Movements::D... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/movements/errors_spec.rb | spec/models/movements/errors_spec.rb | require 'spec_helper'
describe Movements::Errors do
before(:each) do
UserSession.user = build :user, id: 1
end
it "sets negative_balance" do
i = Income.new(total: 0, balance: -1)
Movements::Errors.new(i).set_errors
i.stub(valid?: true)
i.save
i.should be_has_error
i.error_messages.... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/account_types/new.html.haml_spec.rb | spec/views/account_types/new.html.haml_spec.rb | require 'spec_helper'
describe "account_types/new.html.haml" do
before(:each) do
assign(:account_type, stub_model(AccountType,
:name => "MyString",
:number => "MyString"
).as_new_record)
end
it "renders new account_type form" do
render
# Run the generator again with the --webrat fla... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/account_types/edit.html.haml_spec.rb | spec/views/account_types/edit.html.haml_spec.rb | require 'spec_helper'
describe "account_types/edit.html.haml" do
before(:each) do
@account_type = assign(:account_type, stub_model(AccountType,
:name => "MyString",
:number => "MyString"
))
end
it "renders the edit account_type form" do
render
# Run the generator again with the --we... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/account_types/index.html.haml_spec.rb | spec/views/account_types/index.html.haml_spec.rb | require 'spec_helper'
describe "account_types/index.html.haml" do
before(:each) do
assign(:account_types, [
stub_model(AccountType,
:name => "Name",
:number => "Number"
),
stub_model(AccountType,
:name => "Name",
:number => "Number"
)
])
end
it "re... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/account_types/show.html.haml_spec.rb | spec/views/account_types/show.html.haml_spec.rb | require 'spec_helper'
describe "account_types/show.html.haml" do
before(:each) do
@account_type = assign(:account_type, stub_model(AccountType,
:name => "Name",
:number => "Number"
))
end
it "renders attributes in <p>" do
render
# Run the generator again with the --webrat flag if you... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/payments/new.html.haml_spec.rb | spec/views/payments/new.html.haml_spec.rb | require 'spec_helper'
describe "payments/new.html.haml" do
before(:each) do
assign(:payment, stub_model(Payment,
:amount => "9.99",
:interests_penalties => "9.99",
:description => "MyString"
).as_new_record)
end
it "renders new payment form" do
render
# Run the generator again... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/payments/edit.html.haml_spec.rb | spec/views/payments/edit.html.haml_spec.rb | require 'spec_helper'
describe "payments/edit.html.haml" do
before(:each) do
@payment = assign(:payment, stub_model(Payment,
:amount => "9.99",
:interests_penalties => "9.99",
:description => "MyString"
))
end
it "renders the edit payment form" do
render
# Run the generator ag... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/payments/index.html.haml_spec.rb | spec/views/payments/index.html.haml_spec.rb | require 'spec_helper'
describe "payments/index.html.haml" do
before(:each) do
assign(:payments, [
stub_model(Payment,
:amount => "9.99",
:interests_penalties => "9.99",
:description => "Description"
),
stub_model(Payment,
:amount => "9.99",
:interests_pen... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/payments/show.html.haml_spec.rb | spec/views/payments/show.html.haml_spec.rb | require 'spec_helper'
describe "payments/show.html.haml" do
before(:each) do
@payment = assign(:payment, stub_model(Payment,
:amount => "9.99",
:interests_penalties => "9.99",
:description => "Description"
))
end
it "renders attributes in <p>" do
render
# Run the generator agai... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/inventory_operations/new.html.haml_spec.rb | spec/views/inventory_operations/new.html.haml_spec.rb | require 'spec_helper'
describe "inventory_operations/new.html.haml" do
before(:each) do
assign(:inventory_operation, stub_model(InventoryOperation,
:ref_number => "MyString",
:cotanct_id => 1,
:description => "MyString"
).as_new_record)
end
it "renders new inventory_operation form" do
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/inventory_operations/edit.html.haml_spec.rb | spec/views/inventory_operations/edit.html.haml_spec.rb | require 'spec_helper'
describe "inventory_operations/edit.html.haml" do
before(:each) do
@inventory_operation = assign(:inventory_operation, stub_model(InventoryOperation,
:ref_number => "MyString",
:cotanct_id => 1,
:description => "MyString"
))
end
it "renders the edit inventory_oper... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/inventory_operations/index.html.haml_spec.rb | spec/views/inventory_operations/index.html.haml_spec.rb | require 'spec_helper'
describe "inventory_operations/index.html.haml" do
before(:each) do
assign(:inventory_operations, [
stub_model(InventoryOperation,
:ref_number => "Ref Number",
:cotanct_id => 1,
:description => "Description"
),
stub_model(InventoryOperation,
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/inventory_operations/show.html.haml_spec.rb | spec/views/inventory_operations/show.html.haml_spec.rb | require 'spec_helper'
describe "inventory_operations/show.html.haml" do
before(:each) do
@inventory_operation = assign(:inventory_operation, stub_model(InventoryOperation,
:ref_number => "Ref Number",
:cotanct_id => 1,
:description => "Description"
))
end
it "renders attributes in <p>"... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/currencies/show.html.erb_spec.rb | spec/views/currencies/show.html.erb_spec.rb | require 'spec_helper'
describe "currencies/show.html.erb" do
before(:each) do
assign(:currency, @currency = stub_model(Currency,
:name => "MyString",
:symbol => "MyString"
))
end
it "renders attributes in <p>" do
render
response.should contain("MyString")
response.should contain(... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/currencies/new.html.erb_spec.rb | spec/views/currencies/new.html.erb_spec.rb | require 'spec_helper'
describe "currencies/new.html.erb" do
before(:each) do
assign(:currency, stub_model(Currency,
:new_record? => true,
:name => "MyString",
:symbol => "MyString"
))
end
it "renders new currency form" do
render
response.should have_selector("form", :action =>... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/currencies/edit.html.erb_spec.rb | spec/views/currencies/edit.html.erb_spec.rb | require 'spec_helper'
describe "currencies/edit.html.erb" do
before(:each) do
assign(:currency, @currency = stub_model(Currency,
:new_record? => false,
:name => "MyString",
:symbol => "MyString"
))
end
it "renders the edit currency form" do
render
response.should have_selector... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/currencies/index.html.erb_spec.rb | spec/views/currencies/index.html.erb_spec.rb | require 'spec_helper'
describe "currencies/index.html.erb" do
before(:each) do
assign(:currencies, [
stub_model(Currency,
:name => "MyString",
:symbol => "MyString"
),
stub_model(Currency,
:name => "MyString",
:symbol => "MyString"
)
])
end
it "ren... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/units/show.html.erb_spec.rb | spec/views/units/show.html.erb_spec.rb | require 'spec_helper'
describe "units/show.html.erb" do
before(:each) do
assign(:unit, @unit = stub_model(Unit,
:name => "MyString",
:abbreviation => "MyString",
:description => "MyString",
:integer => false
))
end
it "renders attributes in <p>" do
render
response.should ... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/units/new.html.erb_spec.rb | spec/views/units/new.html.erb_spec.rb | require 'spec_helper'
describe "units/new.html.erb" do
before(:each) do
assign(:unit, stub_model(Unit,
:new_record? => true,
:name => "MyString",
:abbreviation => "MyString",
:description => "MyString",
:integer => false
))
end
it "renders new unit form" do
render
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/units/edit.html.erb_spec.rb | spec/views/units/edit.html.erb_spec.rb | require 'spec_helper'
describe "units/edit.html.erb" do
before(:each) do
assign(:unit, @unit = stub_model(Unit,
:new_record? => false,
:name => "MyString",
:abbreviation => "MyString",
:description => "MyString",
:integer => false
))
end
it "renders the edit unit form" do
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/units/index.html.erb_spec.rb | spec/views/units/index.html.erb_spec.rb | require 'spec_helper'
describe "units/index.html.erb" do
before(:each) do
assign(:units, [
stub_model(Unit,
:name => "MyString",
:abbreviation => "MyString",
:description => "MyString",
:integer => false
),
stub_model(Unit,
:name => "MyString",
:a... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/links/show.html.erb_spec.rb | spec/views/links/show.html.erb_spec.rb | require 'spec_helper'
describe "links/show.html.erb" do
before(:each) do
assign(:link, @link = stub_model(Link,
:name => "MyString",
:organisation => nil,
:user => nil,
:role => "MyString",
:settings => "MyString"
))
end
it "renders attributes in <p>" do
render
resp... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/links/new.html.erb_spec.rb | spec/views/links/new.html.erb_spec.rb | require 'spec_helper'
describe "links/new.html.erb" do
before(:each) do
assign(:link, stub_model(Link,
:new_record? => true,
:name => "MyString",
:organisation => nil,
:user => nil,
:role => "MyString",
:settings => "MyString"
))
end
it "renders new link form" do
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/links/edit.html.erb_spec.rb | spec/views/links/edit.html.erb_spec.rb | require 'spec_helper'
describe "links/edit.html.erb" do
before(:each) do
assign(:link, @link = stub_model(Link,
:new_record? => false,
:name => "MyString",
:organisation => nil,
:user => nil,
:role => "MyString",
:settings => "MyString"
))
end
it "renders the edit lin... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/links/index.html.erb_spec.rb | spec/views/links/index.html.erb_spec.rb | require 'spec_helper'
describe "links/index.html.erb" do
before(:each) do
assign(:links, [
stub_model(Link,
:name => "MyString",
:organisation => nil,
:user => nil,
:role => "MyString",
:settings => "MyString"
),
stub_model(Link,
:name => "MyStrin... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/configurations/index.html.haml_spec.rb | spec/views/configurations/index.html.haml_spec.rb | require 'spec_helper'
describe "configurations/index.html.haml" do
pending "add some examples to (or delete) #{__FILE__}"
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/organisations/show.html.erb_spec.rb | spec/views/organisations/show.html.erb_spec.rb | require 'spec_helper'
describe "organisations/show.html.erb" do
before(:each) do
assign(:organisation, @organisation = stub_model(Organisation,
:user => nil,
:country => nil,
:name => "MyString",
:address => "MyString",
:address_alt => "MyString",
:phone => "MyString",
:... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/organisations/new.html.erb_spec.rb | spec/views/organisations/new.html.erb_spec.rb | require 'spec_helper'
describe "organisations/new.html.erb" do
before(:each) do
assign(:organisation, stub_model(Organisation,
:new_record? => true,
:user => nil,
:country => nil,
:name => "MyString",
:address => "MyString",
:address_alt => "MyString",
:phone => "MyStrin... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/organisations/edit.html.erb_spec.rb | spec/views/organisations/edit.html.erb_spec.rb | require 'spec_helper'
describe "organisations/edit.html.erb" do
before(:each) do
assign(:organisation, @organisation = stub_model(Organisation,
:new_record? => false,
:user => nil,
:country => nil,
:name => "MyString",
:address => "MyString",
:address_alt => "MyString",
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/organisations/index.html.erb_spec.rb | spec/views/organisations/index.html.erb_spec.rb | require 'spec_helper'
describe "organisations/index.html.erb" do
before(:each) do
assign(:organisations, [
stub_model(Organisation,
:user => nil,
:country => nil,
:name => "MyString",
:address => "MyString",
:address_alt => "MyString",
:phone => "MyString",
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/stores/show.html.erb_spec.rb | spec/views/stores/show.html.erb_spec.rb | require 'spec_helper'
describe "stores/show.html.erb" do
before(:each) do
assign(:store, @store = stub_model(Store,
:name => "MyString",
:address => "MyString",
:phone => "MyString",
:active => false,
:description => "MyString"
))
end
it "renders attributes in <p>" do
r... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/views/stores/new.html.erb_spec.rb | spec/views/stores/new.html.erb_spec.rb | require 'spec_helper'
describe "stores/new.html.erb" do
before(:each) do
assign(:store, stub_model(Store,
:new_record? => true,
:name => "MyString",
:address => "MyString",
:phone => "MyString",
:active => false,
:description => "MyString"
))
end
it "renders new store... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.