Run rubocop --fix-layout and remove encoding comments
This commit is contained in:
parent
fa63e6e81d
commit
ea2862fdef
283 changed files with 1164 additions and 1969 deletions
|
|
@ -1,7 +1,6 @@
|
|||
require 'factory_bot'
|
||||
|
||||
FactoryBot.define do
|
||||
|
||||
factory :_article do
|
||||
unit { Faker::Unit.unit }
|
||||
price { rand(0.1..26.0).round(2) }
|
||||
|
|
@ -32,5 +31,4 @@ FactoryBot.define do
|
|||
factory :article_category do
|
||||
sequence(:name) { |n| Faker::Lorem.characters(number: rand(2..12)) + " ##{n}" }
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
require 'factory_bot'
|
||||
|
||||
FactoryBot.define do
|
||||
|
||||
factory :bank_account do
|
||||
name { Faker::Bank.name }
|
||||
iban { Faker::Bank.iban }
|
||||
|
|
@ -11,5 +10,4 @@ FactoryBot.define do
|
|||
date { Faker::Date.backward(days: 14) }
|
||||
text { Faker::Lorem.sentence }
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ require 'factory_bot'
|
|||
require 'doorkeeper'
|
||||
|
||||
FactoryBot.define do
|
||||
|
||||
factory :oauth2_application, class: Doorkeeper::Application do
|
||||
name { Faker::App.name }
|
||||
redirect_uri { 'https://example.com:1234/app' }
|
||||
|
|
@ -11,5 +10,4 @@ FactoryBot.define do
|
|||
factory :oauth2_access_token, class: Doorkeeper::AccessToken do
|
||||
application factory: :oauth2_application
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
require 'factory_bot'
|
||||
|
||||
FactoryBot.define do
|
||||
|
||||
factory :financial_transaction_class do
|
||||
sequence(:name) { |n| Faker::Lorem.characters(number: rand(2..12)) + " ##{n}" }
|
||||
end
|
||||
|
|
@ -10,5 +9,4 @@ FactoryBot.define do
|
|||
financial_transaction_class
|
||||
sequence(:name) { |n| Faker::Lorem.words(number: rand(2..4)).join(' ') + " ##{n}" }
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
require 'factory_bot'
|
||||
|
||||
FactoryBot.define do
|
||||
|
||||
# requires order
|
||||
factory :group_order do
|
||||
ordergroup { create(:user, groups: [FactoryBot.create(:ordergroup)]).ordergroup }
|
||||
updated_by { create :user }
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
require 'factory_bot'
|
||||
|
||||
FactoryBot.define do
|
||||
|
||||
# requires order_article
|
||||
factory :group_order_article do
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
require 'factory_bot'
|
||||
|
||||
FactoryBot.define do
|
||||
|
||||
# requires order_article
|
||||
factory :group_order_article_quantity do
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
require 'factory_bot'
|
||||
|
||||
FactoryBot.define do
|
||||
|
||||
factory :invoice do
|
||||
supplier
|
||||
number { rand(1..99999) }
|
||||
|
|
@ -12,5 +11,4 @@ FactoryBot.define do
|
|||
invoice.supplier.reload
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
require 'factory_bot'
|
||||
|
||||
FactoryBot.define do
|
||||
|
||||
factory :order do
|
||||
starts { Time.now }
|
||||
supplier { create :supplier, article_count: (article_count.nil? ? true : article_count) }
|
||||
|
|
@ -25,5 +24,4 @@ FactoryBot.define do
|
|||
order.reload
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
require 'factory_bot'
|
||||
|
||||
FactoryBot.define do
|
||||
|
||||
factory :supplier do
|
||||
name { Faker::Company.name.truncate(30) }
|
||||
phone { Faker::PhoneNumber.phone_number }
|
||||
|
|
@ -14,6 +13,7 @@ FactoryBot.define do
|
|||
before :create do |supplier, evaluator|
|
||||
next if supplier.class == SharedSupplier
|
||||
next if supplier.supplier_category_id?
|
||||
|
||||
supplier.supplier_category = create :supplier_category
|
||||
end
|
||||
|
||||
|
|
@ -30,5 +30,4 @@ FactoryBot.define do
|
|||
sequence(:name) { |n| Faker::Lorem.characters(number: rand(2..12)) + " ##{n}" }
|
||||
financial_transaction_class
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
require 'factory_bot'
|
||||
|
||||
FactoryBot.define do
|
||||
|
||||
factory :user do
|
||||
sequence(:nick) { |n| "user#{n}"}
|
||||
sequence(:nick) { |n| "user#{n}" }
|
||||
first_name { Faker::Name.first_name }
|
||||
email { Faker::Internet.email }
|
||||
password { new_random_password }
|
||||
|
|
@ -32,7 +31,7 @@ FactoryBot.define do
|
|||
end
|
||||
|
||||
factory :group do
|
||||
sequence(:name) {|n| "Group ##{n}"}
|
||||
sequence(:name) { |n| "Group ##{n}" }
|
||||
|
||||
factory :workgroup do
|
||||
type { '' }
|
||||
|
|
@ -40,11 +39,10 @@ FactoryBot.define do
|
|||
|
||||
factory :ordergroup do
|
||||
type { 'Ordergroup' }
|
||||
sequence(:name) {|n| "Order group ##{n}"}
|
||||
sequence(:name) { |n| "Order group ##{n}" }
|
||||
# workaround to avoid needing to save the ordergroup
|
||||
# avoids e.g. error after logging in related to applebar
|
||||
after :create do |group| Ordergroup.find(group.id).update_stats! end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue