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/db/migrate/20140217120803_add_users_old_emails.rb | db/migrate/20140217120803_add_users_old_emails.rb | class AddUsersOldEmails < ActiveRecord::Migration
def up
PgTools.with_schemas %w(common public) do
add_column :users, :old_emails, :text, array: true, default: []
end
end
def down
PgTools.with_schemas %w(common public) do
remove_column :users, :old_emails
end
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/db/migrate/20130221151829_add_country_to_organisations.rb | db/migrate/20130221151829_add_country_to_organisations.rb | class AddCountryToOrganisations < ActiveRecord::Migration
def up
PgTools.with_schemas only: ['common', 'public'] do
add_column :organisations, :country_code, :string, limit: 5
add_index :organisations, :country_code
end
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/db/migrate/20130716131801_add_items_updater.rb | db/migrate/20130716131801_add_items_updater.rb | class AddItemsUpdater < ActiveRecord::Migration
def up
PgTools.with_schemas except: 'common' do
change_table :items do |t|
t.integer :updater_id
end
add_index :items, :updater_id
end
end
def down
PgTools.with_schemas except: 'common' do
change_table :items do |t|
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/db/migrate/20140828122720_create_attachments.rb | db/migrate/20140828122720_create_attachments.rb | class CreateAttachments < ActiveRecord::Migration
def up
PgTools.with_schemas except: 'common' do
create_table :attachments do |t|
t.string :attachment_uid
t.string :name
t.integer :attachable_id
t.string :attachable_type
t.integer :user_id
t.integer :position... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/db/migrate/20131229164735_update_accounts_due_date_extras_index.rb | db/migrate/20131229164735_update_accounts_due_date_extras_index.rb | class UpdateAccountsDueDateExtrasIndex < ActiveRecord::Migration
def up
PgTools.with_schemas except: 'common' do
execute 'UPDATE accounts a SET due_date = t.due_date FROM transactions t WHERE t.account_id = a.id'
add_index :accounts, :extras, using: :gist
#add_index :accounts, "(extras->'delive... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/autotest/discover.rb | autotest/discover.rb | Autotest.add_discovery { "rails" }
Autotest.add_discovery { "rspec2" }
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/factories.rb | spec/factories.rb | # encoding: utf-8
FactoryGirl.define do
factory :attachment do
name 'picture.jpg'
position 1
attachable_id 1
attachable_type 'Item'
end
factory :unit do
name 'Kilogramo'
symbol 'Kg.'
visible true
end
factory :org_country do
name 'Boliva'
code 'BO'
abbreviation 'bo'
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/spec_helper.rb | spec/spec_helper.rb | # This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
#require 'rspec/autorun'
require "shoulda/matchers"
Shoulda::Matchers.configure do |config|
config.integrate do |with|
# Choo... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/services/user_password_spec.rb | spec/services/user_password_spec.rb | require 'spec_helper'
describe UserPassword do
let(:user) { create :user, id: 10, password: 'demo1234' }
before(:each) do
UserSession.user = user
end
it "sets errors" do
up = UserPassword.new(password: 'demo123', old_password: 'demo123')
up.update_password.should eq(false)
up.errors[:password... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/services/devolution_spec.rb | spec/services/devolution_spec.rb | # encoding: utf-8
require 'spec_helper'
describe Devolution do
let(:valid_attributes) {
{
account_id: 10, account_to_id: 2, exchange_rate: 1,
amount: 50, reference: 'El primer pago',
verification: false, date: Date.today
}
}
let(:account_id) { valid_attributes.fetch(:account_id) }
l... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/services/null_account_ledger_spec.rb | spec/services/null_account_ledger_spec.rb | # encoding: utf-8
require 'spec_helper'
describe NullAccountLedger do
before(:each) do
UserSession.user = build :user, id: 11
OrganisationSession.organisation = build :organisation, currency: 'BOB'
end
it "only allow account ledgers" do
expect { NullAccountLedger.new(Object.new) }.to raise_error
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/services/admin_user_spec.rb | spec/services/admin_user_spec.rb | # encoding: utf-8
require 'spec_helper'
describe AdminUser do
before(:each) do
UserSession.user = build :user, id: 10
end
let!(:organisation) { create :organisation, id: 15, tenant: 'bonsaierp' }
let(:attributes) {
{
email: 'new_user@mail.com', first_name: 'New', last_name: 'User', role: 'group'... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/services/tenant_creator_spec.rb | spec/services/tenant_creator_spec.rb | require 'spec_helper'
describe TenantCreator do
let(:tenant) { 'bonsaierp' }
let(:organisation) { create(:organisation, id: 1, tenant: tenant) }
before(:all) do
DatabaseCleaner.strategy = :truncation
end
after(:all) do
PgTools.drop_schema tenant if PgTools.schema_exists?('bonsaierp')
DatabaseCl... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/services/number_to_words_es_spec.rb | spec/services/number_to_words_es_spec.rb | require 'spec_helper'
describe NumberToWordsEs do
it "#initialize NaN" do
d = BigDecimal.new('NaN')
ntw = NumberToWordsEs.new(d)
expect(ntw.number).to eq(0)
end
it "#to_words" do
ntw = NumberToWordsEs.new(1123)
expect(ntw.to_words).to eq('un mil ciento veintitres')
end
it "#to_words mil... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/services/reset_password_spec.rb | spec/services/reset_password_spec.rb | require 'spec_helper'
describe ResetPassword do
it { should_not have_valid(:password).when('demo214', 'sim3') }
it '#validates' do
rp = ResetPassword.new(password: 'demo1234')
rp.stub(user: build(:user))
rp.should_not be_valid
rp.errors.messages[:password].should eq([I18n.t('errors.messages.confi... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/services/transference_spec.rb | spec/services/transference_spec.rb | # encoding: utf-8
require 'spec_helper'
describe Transference do
let(:account){ build :cash, currency: 'BOB', id: 1 }
let(:account_to){ build :account, currency: 'BOB', id: 2 }
let(:account_usd) { build :cash, currency: 'USD', id: 3 }
let(:valid_attributes) {
{
account_id: account.id, account_to_id:... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/services/controller_service_serializer_spec.rb | spec/services/controller_service_serializer_spec.rb | require 'spec_helper'
describe ControllerServiceSerializer do
let(:contact) { build :contact, id: 10 }
it "#default" do
css = ControllerServiceSerializer.new(contact)
css.to_json.should eq(contact.to_json(methods: [:errors, :to_s]))
end
it "#methods" do
css = ControllerServiceSerializer.new(conta... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/services/movement_params_spec.rb | spec/services/movement_params_spec.rb | require 'spec_helper'
describe MovementParams do
subject { MovementParams.new }
it "params income" do
subject.income.should eq([
:date, :contact_id, :currency, :exchange_rate, :project_id,
:description, :due_date, :total,
:direct_payment, :account_to_id, :reference, :tax_id, :tax_in_out,
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/services/contact_balance_status_spec.rb | spec/services/contact_balance_status_spec.rb | require 'spec_helper'
describe ContactBalanceStatus do
class TransTest < Struct.new(:tot, :tot_cur, :currency)
end
let(:organisation) { build :organisation, currency: 'BOB'}
before(:each) do
OrganisationSession.organisation = organisation
end
let(:balances) {
[
TransTest.new('10.2', '10.0',... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/services/movement_service_spec.rb | spec/services/movement_service_spec.rb | require 'spec_helper'
describe MovementService do
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/services/reset_password_email_spec.rb | spec/services/reset_password_email_spec.rb | # encoding: utf-8
require 'spec_helper'
describe ResetPasswordEmail do
let(:user) { build :user, id: 2 }
it "send ResetPasswordEmailMailer" do
User.stub_chain(:active, where: [user] )
user.stub(save: true, active_links: [build(:link, active: true, tenant: 'bonsai')])
PgTools.stub(schema_exists?: true)... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/services/conciliate_account_spec.rb | spec/services/conciliate_account_spec.rb | # encoding: utf-8
require 'spec_helper'
describe ConciliateAccount do
it "only allow account ledgers" do
expect { ConciliateAccount.new(Object.new) }.to raise_error
end
describe 'Conciliation' do
before(:each) do
UserSession.user = build :user, id: 1
end
it "does not conciliate nulled, or... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/services/base_service_spec.rb | spec/services/base_service_spec.rb | require 'spec_helper'
describe BaseService do
subject { BaseService.new }
it { should_not be_persisted }
it "Uses ActiveModel::Errors for errors" do
subject.errors.should be_is_a(ActiveModel::Errors)
end
context "Check commit rollback" do
subject do
class TestRollback < BaseService
at... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/services/update_default_password_spec.rb | spec/services/update_default_password_spec.rb | require 'spec_helper'
describe UpdateDefaultPassword do
let(:user) { build :user, id: 10 }
let(:attributes) { { password: 'DEMO1234', password_confirmation: 'DEMO1234', user: user } }
it "valid user" do
up = UpdateDefaultPassword.new(password: 'demo1234', user: nil, password_confirmation: 'demo1234')
u... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/services/registration_spec.rb | spec/services/registration_spec.rb | # encoding: utf-8
require "spec_helper"
describe Registration do
let(:valid_attributes) do
{name: 'bonsaiERP', email: 'borisb@bonsaierp.com',
password: 'Demo1234'}
end
it { should have_valid(:email).when('borisb@mail.com', 'si@me.com.bo') }
it { should_not have_valid(:email).when(' ', 'si@me.com.') ... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/services/payment_service_spec.rb | spec/services/payment_service_spec.rb | # encoding: utf-8
require 'spec_helper'
describe PaymentService do
let(:movement){ Income.new(currency: 'BOB') {|i| i.id = 1 } }
let(:account_to){ build :account, currency: 'USD', id: 2 }
let(:valid_attributes) {
{
account_id: movement.id, account_to_id: account_to.id, exchange_rate: 7.011,
amo... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/services/unique_item_spec.rb | spec/services/unique_item_spec.rb | require 'spec_helper'
describe UniqueItem do
let(:income) { build :income }
it "#valid true" do
income.income_details.build(item_id: 1, quantity: 2)
income.income_details.build(item_id: 2, quantity: 2)
UniqueItem.new(income).should be_valid
income.details.size.should eq(2)
end
it "#valid fal... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/support/helpers.rb | spec/support/helpers.rb | module Helpers
def stub_authorization
controller.stub(set_tenant: true, check_authorization!:true)
end
alias_method :stub_auth, :stub_authorization
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/support/auth_macros.rb | spec/support/auth_macros.rb | module AuthMacros
def create_user_session
UserSession.current_user = User.new {|u| u.id = 1}
end
def stub_tenant(tenant = 'public')
controller.stub(current_tenant: tenant)
end
def stub_auth_and_tenant(tenant = 'public')
stub_auth
stub_tenant(tenant)
end
def create_organisation_session
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/support/request_helper.rb | spec/support/request_helper.rb | module Request
extend self
module JsonHelpers
def json
@json ||= JSON.parse(response.body)
end
end
def host
ActionMailer::Base.default_url_options[:host]
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/support/mod_stubs.rb | spec/support/mod_stubs.rb | # encoding: utf-8
# author: Boris Barroso
# email: boriscyber@gmail.com
module ModStubs
class << self
def stub_account_type(data)
data = data.merge(:name => data[:name] || data[:account_number].downcase)
a = AccountType.new(data) {|a|
a.id = data[:id] || 1
a.account_number = data[:ac... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/integration/first_test.rb | spec/integration/first_test.rb | require 'spec_helper'
feature 'New feature' do
scenario "test scenario" do
puts "Right at home"
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/routing/projects_routing_spec.rb | spec/routing/projects_routing_spec.rb | require "spec_helper"
describe ProjectsController do
describe "routing" do
it "recognizes and generates #index" do
{ :get => "/projects" }.should route_to(:controller => "projects", :action => "index")
end
it "recognizes and generates #new" do
{ :get => "/projects/new" }.should route_to(:co... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/routing/payments_routing_spec.rb | spec/routing/payments_routing_spec.rb | require "spec_helper"
describe PaymentsController do
describe "routing" do
it "#new_income" do
{ :get => "/payments/1/new_income" }.should route_to(:controller => "payments", :action => "new_income", id: '1')
end
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/presenters/ledger_operation_presenter_spec.rb | spec/presenters/ledger_operation_presenter_spec.rb | require 'spec_helper'
require 'action_view'
require 'resubject/rspec'
#require 'presenters/base_presenter'
describe LedgerOperationPresenter do
it "operation" do
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/presenters/account_ledger_presenter_spec.rb | spec/presenters/account_ledger_presenter_spec.rb | require 'spec_helper'
require 'action_view'
require 'resubject/rspec'
describe AccountLedgerPresenter do
let(:account1) { build :account, currency: 'USD', id: 1 }
let(:account2) { build :account, currency: 'BOB', id: 2 }
before(:each) do
OrganisationSession.stub(currency: 'BOB')
end
it "#amount_ref" do... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/presenters/loans/receive_presenter_spec.rb | spec/presenters/loans/receive_presenter_spec.rb | require 'spec_helper'
describe Loans::ReceivePresenter do
let(:view_context) { ActionView::Base.new }
let(:loan) { build :loan_give, id: 10 }
let (:loan_p) { Loans::ReceivePresenter.new(loan, view_context) }
it '#new_ledger_in_path' do
allow(view_context).to receive(:new_receive_loan_ledger_in_path).with(... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/presenters/loans/give_presenter_spec.rb | spec/presenters/loans/give_presenter_spec.rb | require 'spec_helper'
describe Loans::GivePresenter do
let(:view_context) { ActionView::Base.new }
let(:loan) { build :loan_give, id: 10 }
let (:loan_p) { Loans::GivePresenter.new(loan, view_context) }
it '#new_ledger_in_path' do
allow(view_context).to receive(:new_give_loan_ledger_in_path).with(10).and_r... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/requests/inventory_operations_spec.rb | spec/requests/inventory_operations_spec.rb | require 'spec_helper'
describe "InventoryOperations" do
describe "GET /inventory_operations" do
it "works! (now write some real specs)" do
# Run the generator again with the --webrat flag if you want to use webrat methods/matchers
get inventory_operations_path
response.status.should be(200)
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/requests/stores_spec.rb | spec/requests/stores_spec.rb | require 'spec_helper'
describe "Stores" do
describe "GET /stores" do
it "works! (now write some real specs)" do
get stores_path
end
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/requests/contacts_spec.rb | spec/requests/contacts_spec.rb | require 'spec_helper'
describe "Contacts" do
describe "GET /contacts" do
it "works! (now write some real specs)" do
get contacts_path
end
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/requests/items_spec.rb | spec/requests/items_spec.rb | require 'spec_helper'
describe "Items" do
describe "GET /items" do
it "works! (now write some real specs)" do
get items_path
end
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/requests/account_balances_spec.rb | spec/requests/account_balances_spec.rb | require 'spec_helper'
describe "AccountBalances" do
describe "GET /account_balances" do
it "works! (now write some real specs)" do
# Run the generator again with the --webrat flag if you want to use webrat methods/matchers
get account_balances_path
response.status.should be(200)
end
end
e... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/requests/projects_spec.rb | spec/requests/projects_spec.rb | require 'spec_helper'
describe "Projects" do
describe "GET /projects" do
it "works! (now write some real specs)" do
# Run the generator again with the --webrat flag if you want to use webrat methods/matchers
get projects_path
response.status.should be(200)
end
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/requests/account_types_spec.rb | spec/requests/account_types_spec.rb | require 'spec_helper'
describe "AccountTypes" do
describe "GET /account_types" do
it "works! (now write some real specs)" do
# Run the generator again with the --webrat flag if you want to use webrat methods/matchers
get account_types_path
response.status.should be(200)
end
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/requests/transactions_spec.rb | spec/requests/transactions_spec.rb | require 'spec_helper'
describe "Transactions" do
describe "GET /transactions" do
it "works! (now write some real specs)" do
get transactions_path
end
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/requests/accounts_spec.rb | spec/requests/accounts_spec.rb | require 'spec_helper'
describe "Accounts" do
describe "GET /accounts" do
it "works! (now write some real specs)" do
# Run the generator again with the --webrat flag if you want to use webrat methods/matchers
get accounts_path
response.status.should be(200)
end
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/requests/payments_spec.rb | spec/requests/payments_spec.rb | require 'spec_helper'
describe "Payments" do
describe "GET /payments" do
it "works! (now write some real specs)" do
# Run the generator again with the --webrat flag if you want to use webrat methods/matchers
get payments_path
response.status.should be(200)
end
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/organisations_controller_spec.rb | spec/controllers/organisations_controller_spec.rb | require 'spec_helper'
describe OrganisationsController do
let(:organisation) { create :organisation }
let(:user) { create :user }
let(:link) {
organisation.links.build(user_id: user.id).create
}
before do
controller.stub(:check_authorization! => true, current_user: user)
UserSession.user = use... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/errors_controller_spec.rb | spec/controllers/errors_controller_spec.rb | require 'spec_helper'
describe ErrorsController do
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/expenses_controller_spec.rb | spec/controllers/expenses_controller_spec.rb | require 'spec_helper'
describe ExpensesController do
before(:each) do
stub_auth
controller.stub(currency: 'BOB')
end
describe "POST /expenses" do
let(:expense) do
inc = build(:expense, id: 1)
inc.stub(persisted?: true)
inc
end
before(:each) do
DefaultExpense.any_inst... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/export_expenses_controller_spec.rb | spec/controllers/export_expenses_controller_spec.rb | require 'spec_helper'
describe ExportExpensesController do
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/attachments_controller_spec.rb | spec/controllers/attachments_controller_spec.rb | require 'spec_helper'
describe AttachmentsController do
let(:item) {
item = build :item
item.stub(valid?: true)
item.save
item
}
describe 'POST #create' do
it "OK" do
post :create
end
end
describe 'PATCH #update' do
pending 'Tests'
end
describe 'DELETE #destroy' do
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/registrations_controller_spec.rb | spec/controllers/registrations_controller_spec.rb | require 'spec_helper'
describe RegistrationsController do
let(:tenant) { 'tenant' }
before(:each) do
#ALLOW_REGISTRATIONS = true
end
describe "GET /registrations/new" do
it 'should redirect to register' do
get 'new'
expect(response.ok?).to eq(true)
end
#it "not allowed registrat... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/configurations_controller_spec.rb | spec/controllers/configurations_controller_spec.rb | require 'spec_helper'
describe ConfigurationsController do
before(:each) do
stub_auth
end
describe "GET 'index'" do
it "returns http success" do
get :index
response.should be_success
end
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/contacts_controller_spec.rb | spec/controllers/contacts_controller_spec.rb | require 'spec_helper'
describe ContactsController do
before(:each) do
stub_auth
end
def mock_contact(stubs={})
@mock_contact ||= mock_model(Contact, stubs).as_null_object
end
describe "GET index" do
it "assigns all contacts as @contacts" do
Contacts::Query.any_instance.stub_chain(:index, ... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/user_passwords_controller_spec.rb | spec/controllers/user_passwords_controller_spec.rb | # encoding: utf-8
require 'spec_helper'
describe UserPasswordsController do
let(:user) { build :user, id: 10 }
before(:each) do
stub_auth
user.stub(persisted?: true)
controller.stub(current_user: user)
end
it "check stubed methods" do
[:update_password].each do |m|
UserPassword.should b... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/expenses_inventory_outs_controller_spec.rb | spec/controllers/expenses_inventory_outs_controller_spec.rb | require 'spec_helper'
describe ExpensesInventoryOutsController do
before(:each) do
stub_auth
end
it "check_methods" do
Expenses::InventoryOut.should be_method_defined(:build_details)
end
describe '/new' do
it ":new" do
Expense.should_receive(:find).with('1').and_return(build(:expense, id:... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/tags_controller_spec.rb | spec/controllers/tags_controller_spec.rb | require 'spec_helper'
describe TagsController do
before(:each) do
stub_auth
end
context 'create' do
it 'create' do
post :create, tag: {name: 'test', bgcolor: '#ff0000'}
assigns(:tag).should be_is_a(Tag)
t = assigns(:tag)
expect(response.body).to eq(t.to_json.to_s)
end
i... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/stores_controller_spec.rb | spec/controllers/stores_controller_spec.rb | require 'spec_helper'
describe StoresController do
describe "DELETE" do
before(:each) do
controller.stubs(:check_authorization! => true)
end
it 'should not delete' do
s = Store.new {|s| s.id = 1}
s.stubs(:destroy => false, :destroyed? => false, :persisted? => true)
Store.stubs(:o... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/batch_payments_controller_spec.rb | spec/controllers/batch_payments_controller_spec.rb | require 'spec_helper'
describe BatchPaymentsController do
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/taxes_controller_spec.rb | spec/controllers/taxes_controller_spec.rb | require 'spec_helper'
describe TaxesController do
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/sessions_controller_spec.rb | spec/controllers/sessions_controller_spec.rb | require "spec_helper"
describe SessionsController do
it "checks all stubbed methods" do
[:authenticate?, :tenant].each do |m|
expect(Session.method_defined?(m)).to eq(true)
end
User.new # Needed to check methods
[:set_auth_token, :auth_token].each do |m|
expect( User.method_defined?(m) )... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/incomes_inventory_ins_controller_spec.rb | spec/controllers/incomes_inventory_ins_controller_spec.rb | require 'spec_helper'
describe IncomesInventoryInsController do
before(:each) do
stub_auth
end
it "check_methods" do
Incomes::InventoryIn.should be_method_defined(:build_details)
end
describe '/new' do
it ":new" do
Income.should_receive(:find).with('1').and_return(build(:income, id: 1))
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/expenses_inventory_ins_controller_spec.rb | spec/controllers/expenses_inventory_ins_controller_spec.rb | require 'spec_helper'
describe ExpensesInventoryInsController do
before(:each) do
stub_auth
end
it "check_methods" do
Expenses::InventoryIn.should be_method_defined(:build_details)
end
describe '/new' do
it ":new" do
Expense.should_receive(:find).with('1').and_return(build(:expense, id: 1... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/items_controller_spec.rb | spec/controllers/items_controller_spec.rb | require 'spec_helper'
describe ItemsController do
let(:user) { build :user, id: 10}
before(:each) do
stub_auth
controller.stub(current_tenant: 'public')
UserSession.user = user
end
let(:item) { build :item, id: 37 }
let(:unit) { create :unit }
let(:item_attrs) { attributes_for(:item).merge(un... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/reset_passwords_controller_spec.rb | spec/controllers/reset_passwords_controller_spec.rb | require 'spec_helper'
describe ResetPasswordsController do
it "test stubed method" do
[:reset_password].each do |m|
ResetPasswordEmail.should be_method_defined(m)
end
ResetPassword.should be_method_defined(:update_password)
end
describe 'GET /reset_passwords/new' do
it "renders the new" ... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/users_controller_spec.rb | spec/controllers/users_controller_spec.rb | require 'spec_helper'
describe UsersController do
before(:each) do
stub_auth
end
describe "GET show" do
it "#show" do
get :show, id: 0
response.should be_success
response.should render_template 'show'
end
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/inventory_outs_controller_spec.rb | spec/controllers/inventory_outs_controller_spec.rb | require 'spec_helper'
describe InventoryOutsController do
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/staff_accounts_controller_spec.rb | spec/controllers/staff_accounts_controller_spec.rb | require 'spec_helper'
describe StaffAccountsController do
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/projects_controller_spec.rb | spec/controllers/projects_controller_spec.rb | require 'spec_helper'
describe ProjectsController do
def mock_project(stubs={})
(@mock_project ||= mock_model(Project).as_null_object).tap do |project|
project.stub(stubs) unless stubs.empty?
end
end
describe "GET index" do
it "assigns all projects as @projects" do
Project.stub(:all) { ... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/stocks_controller_spec.rb | spec/controllers/stocks_controller_spec.rb | require 'spec_helper'
describe StocksController do
before(:each) do
stub_auth
OrganisationSession.set :id => 1
end
describe "GET 'new'" do
it "should be successful" do
get 'new'
response.should be_success
end
it 'should create an instance of an stock' do
Stock.stubs(:new_i... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/inventory_transferences_controller_spec.rb | spec/controllers/inventory_transferences_controller_spec.rb | require 'spec_helper'
describe InventoryTransferencesController do
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/export_incomes_controller_spec.rb | spec/controllers/export_incomes_controller_spec.rb | require 'spec_helper'
describe ExportIncomesController do
describe "GET 'index'" do
it "returns http success" do
get 'index'
response.should be_success
end
end
describe "GET 'show'" do
it "returns http success" do
get 'show'
response.should be_success
end
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/tests_controller_spec.rb | spec/controllers/tests_controller_spec.rb | # encoding: utf-8
require 'spec_helper'
describe TestsController do
let(:user) { build(:user, id: 10) }
before(:each) do
request.stub(subdomain: 'bonsai')
end
context "test current_user" do
it "redirects when there is no current_user" do
subject.should_receive(:redirect_to).with(new_session_url... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/banks_controller_spec.rb | spec/controllers/banks_controller_spec.rb | # encoding: utf-8
require 'spec_helper'
describe BanksController do
before(:each) do
stub_auth
end
describe "GET /new" do
it "creates a new instance of Bank calling money_store" do
get :new
assigns(:bank).should be_is_a(Bank)
assigns(:bank).should respond_to(:address)
response.s... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/cashes_controller_spec.rb | spec/controllers/cashes_controller_spec.rb | require 'spec_helper'
describe CashesController do
before(:each) do
stub_auth
end
describe "GET /new" do
it "creates a new instance of Bank calling money_store" do
get :new
assigns(:cash).should be_is_a(Cash)
assigns(:cash).should respond_to(:address)
response.should render_templ... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/inventory_ins_controller_spec.rb | spec/controllers/inventory_ins_controller_spec.rb | require 'spec_helper'
describe InventoryInsController do
before(:each) do
stub_auth
end
let(:store) { build :store }
let(:inventory) { build :inventory, id: 10 }
describe 'GET /inventory_ins/new' do
it 'OK' do
Store.stub(find: store)
get :new, store_id: 1
response.should be_ok
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/units_controller_spec.rb | spec/controllers/units_controller_spec.rb | require 'spec_helper'
describe UnitsController do
def mock_unit(stubs={})
@mock_unit ||= mock_model(Unit, stubs).as_null_object
end
describe "GET index" do
it "assigns all units as @units" do
Unit.stub(:all) { [mock_unit] }
get :index
assigns(:units).should eq([mock_unit])
end
e... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/account_ledgers_controller_spec.rb | spec/controllers/account_ledgers_controller_spec.rb | require 'spec_helper'
describe AccountLedgersController do
let(:user) { build :user, id: 10}
before(:each) do
stub_auth
controller.stub(current_tenant: 'public')
UserSession.user = user
end
describe 'GET /' do
it "Ok" do
#AccountLedger.should be_respond_to(:pendent)
#AccountLedge... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/dashboard_controller_spec.rb | spec/controllers/dashboard_controller_spec.rb | require 'spec_helper'
describe DashboardController do
#before(:each) do
# stub_auth
#end
#describe 'GET /dashboard' do
# it "correct" do
# get :index
# response.should be_ok
# flash[:error].should be_blank
# end
# it "presents flash error" do
# get :index, date_start: ''
# ... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/incomes_inventory_outs_controller_spec.rb | spec/controllers/incomes_inventory_outs_controller_spec.rb | require 'spec_helper'
describe IncomesInventoryOutsController do
before(:each) do
stub_auth
end
it "check_methods" do
Incomes::InventoryOut.should be_method_defined(:build_details)
end
describe '/new' do
it ":new" do
Income.should_receive(:find).with('1').and_return(build(:income, id: 1))... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/transferences_controller_spec.rb | spec/controllers/transferences_controller_spec.rb | require 'spec_helper'
describe TransferencesController do
describe "GET /transferences/new?account_id" do
it "renders the new" do
AccountQuery.stub_chain(:bank_cash, where: [build(:bank)])
get :new
response.should render_template('new')
end
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/organisation_updates_controller_spec.rb | spec/controllers/organisation_updates_controller_spec.rb | # encoding: utf-8
require 'spec_helper'
describe OrganisationUpdatesController do
let(:organisation) { build :organisation, id: 1 }
before(:each) do
stub_auth
controller.stub(current_organisation: organisation)
end
describe "GET 'edit'" do
it "returns http success" do
get :edit, id: 1
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/loan_ledger_ins_controller_spec.rb | spec/controllers/loan_ledger_ins_controller_spec.rb | require 'spec_helper'
describe LoanLedgerInsController do
let(:user) { build :user, id: 1 }
let(:contact) { create :contact, matchcode: 'James Brown' }
before(:each) do
stub_auth_and_tenant
UserSession.user = user
end
let(:bank) { create :bank, amount: 1000 }
let(:today) { Date.today }
let(:lo... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/tag_groups_controller_spec.rb | spec/controllers/tag_groups_controller_spec.rb | require 'spec_helper'
describe TagGroupsController do
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/incomes_controller_spec.rb | spec/controllers/incomes_controller_spec.rb | require 'spec_helper'
describe IncomesController do
before do
stub_auth
controller.stub(currency: 'BOB')
end
describe "GET /item/new" do
it "initializes" do
get :new
response.should render_template('new')
assigns(:income).currency.should eq('BOB')
end
end
describe "POST /... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/reports_controller_spec.rb | spec/controllers/reports_controller_spec.rb | require 'spec_helper'
describe ReportsController do
it "#index" do
get :index, report: 'items'
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/admin_users_controller_spec.rb | spec/controllers/admin_users_controller_spec.rb | # encoding: utf-8
require 'spec_helper'
describe AdminUsersController do
before(:each) do
stub_auth
controller.stub(currency: 'BOB')
end
describe "GET 'new'" do
it "returns http success" do
get :new
response.should be_success
assigns(:admin_user).should be_is_a(AdminUser)
end
... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/payments_controller_spec.rb | spec/controllers/payments_controller_spec.rb | require 'spec_helper'
describe PaymentsController do
before do
controller.stub!(check_authorization!: true, set_tenant: true, currency_id: 1)
end
context "POST /payments/:id/income" do
it "checks all stub methods" do
raise "IncomePayment#pay method doesn't exists" unless IncomePayment.method_defin... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/api/v1/attachments_controller_spec.rb | spec/controllers/api/v1/attachments_controller_spec.rb | require 'spec_helper'
describe Api::V1::AttachmentsController do
before(:each) do
controller.stub(authenticate_user: true, set_tenant: true, set_user_session: true)
UserSession.user = build :user, id: 1
Income.any_instance.stub(valid?: true)
end
let(:item) {
itm = build :item
itm.stub(valid... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/api/v1/contacts_controller_spec.rb | spec/controllers/api/v1/contacts_controller_spec.rb | require 'spec_helper'
describe Api::V1::ContactsController do
before(:each) do
controller.stub(authenticate_user: true, set_tenant: true, set_user_session: true)
UserSession.user = build :user, id: 1
end
def create_contact
create :contact
end
context 'GET #index' do
it "OK" do
create_... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/api/v1/tags_controller_spec.rb | spec/controllers/api/v1/tags_controller_spec.rb | require 'spec_helper'
describe Api::V1::TagsController do
before(:each) do
controller.stub(authenticate_user: true, set_tenant: true, set_user_session: true, current_user: build(:user))
end
context 'GET :index' do
it "/" do
get :index
expect(response).to be_ok
end
it "with tags" do... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/api/v1/items_controller_spec.rb | spec/controllers/api/v1/items_controller_spec.rb | require 'spec_helper'
describe Api::V1::ItemsController do
let(:user) { create :user }
let(:link) { create :link, user_id: user.id, organisation_id: 10, tenant: 'amaru' }
before(:each) do
controller.stub(set_user_session: true)
request.host = 'amaru.bonsaierp.com'
UserSession.user = user
end
l... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/api/v1/tag_groups_controller_spec.rb | spec/controllers/api/v1/tag_groups_controller_spec.rb | require 'spec_helper'
describe Api::V1::TagGroupsController do
context 'GET /api/v1/tag_groups' do
pending 'index'
end
context 'GET /api/v1/tag_groups/count' do
pending 'count'
end
end
| ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/controllers/api/v1/incomes_controller_spec.rb | spec/controllers/api/v1/incomes_controller_spec.rb | require 'spec_helper'
describe Api::V1::IncomesController do
before(:each) do
controller.stub(authenticate_user: true, set_tenant: true, set_user_session: true)
UserSession.user = build :user, id: 1
Income.any_instance.stub(valid?: true)
IncomeDetail.any_instance.stub(valid?: true)
Item.stub_cha... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/account_ledger_spec.rb | spec/models/account_ledger_spec.rb | # encoding: utf-8
require 'spec_helper'
describe AccountLedger do
it { should belong_to(:account) }
it { should belong_to(:account_to).class_name('Account') }
it { should belong_to(:contact) }
it { should belong_to(:approver).class_name('User') }
it { should belong_to(:nuller).class_name('User') }
it { s... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/contact_spec.rb | spec/models/contact_spec.rb | # encoding: utf-8
# author: Boris Barroso
# email: boriscyber@gmail.com
require 'spec_helper'
describe Contact do
let(:valid_attributes) do
{
matchcode: 'Boris Barroso', first_name: 'Boris', last_name: "Barroso",
organisation_name: 'bonsailabs', email: 'boris@bonsailabs.com',
address: "Los Pin... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/date_range_spec.rb | spec/models/date_range_spec.rb | require 'spec_helper'
describe DateRange do
it "default" do
dr = DateRange.default
de = Date.today
ds = de - 30.days
dr.should be_is_a(DateRange)
dr.date_start.to_s.should eq(ds.to_s)
dr.date_end.to_s.should eq(de.to_s)
end
it "$range" do
dr = DateRange.range('2013-01-01', '2013-03... | ruby | MIT | 0edb91af594f81e7534dbc90525a406c645ad164 | 2026-01-04T17:40:51.865869Z | false |
bonsaiERP/bonsaiERP | https://github.com/bonsaiERP/bonsaiERP/blob/0edb91af594f81e7534dbc90525a406c645ad164/spec/models/country_spec.rb | spec/models/country_spec.rb | # encoding: utf-8
require 'spec_helper'
describe Country do
it "returns the complete name" do
c = Country.find('BO')
c.to_s.should eq('Bolivia BO')
c = Country.find('AR')
c.to_s.should eq('Argentina AR')
end
it "returns the options" do
countries = COUNTRIES.keys.slice(0,4)
options = Co... | 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.