Bundle update
This commit is contained in:
parent
b49bfb0d8c
commit
8a5c130875
13 changed files with 62 additions and 61 deletions
|
|
@ -1,6 +1,6 @@
|
|||
require 'factory_girl'
|
||||
require 'factory_bot'
|
||||
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
|
||||
factory :_article do
|
||||
unit { Faker::Unit.unit }
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
require 'factory_girl'
|
||||
require 'factory_bot'
|
||||
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
|
||||
# requires order
|
||||
factory :group_order do
|
||||
ordergroup { create(:user, groups: [FactoryGirl.create(:ordergroup)]).ordergroup }
|
||||
ordergroup { create(:user, groups: [FactoryBot.create(:ordergroup)]).ordergroup }
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
require 'factory_girl'
|
||||
require 'factory_bot'
|
||||
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
|
||||
# requires order_article
|
||||
factory :group_order_article do
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
require 'factory_girl'
|
||||
require 'factory_bot'
|
||||
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
|
||||
factory :order do
|
||||
starts { Time.now }
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
require 'factory_girl'
|
||||
require 'factory_bot'
|
||||
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
|
||||
factory :supplier do
|
||||
name { Faker::Company.name.truncate(30) }
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
require 'factory_girl'
|
||||
require 'factory_bot'
|
||||
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
|
||||
factory :user do
|
||||
sequence(:nick) { |n| "user#{n}"}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ feature ArticlesController do
|
|||
it 'can create a new article' do
|
||||
click_on I18n.t('articles.index.new')
|
||||
expect(page).to have_selector('form#new_article')
|
||||
article = FactoryGirl.build :article, supplier: supplier, article_category: article_category
|
||||
article = FactoryBot.build :article, supplier: supplier, article_category: article_category
|
||||
within('#new_article') do
|
||||
fill_in 'article_name', :with => article.name
|
||||
fill_in 'article_unit', :with => article.unit
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ describe Article do
|
|||
let(:article) { create :article, supplier: supplier }
|
||||
|
||||
it 'has a unique name' do
|
||||
article2 = FactoryGirl.build :article, supplier: supplier, name: article.name
|
||||
article2 = FactoryBot.build :article, supplier: supplier, name: article.name
|
||||
expect(article2).to be_invalid
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@ describe GroupOrder do
|
|||
# the following two tests are currently disabled - https://github.com/foodcoops/foodsoft/issues/158
|
||||
|
||||
#it 'needs an order' do
|
||||
# expect(FactoryGirl.build(:group_order, ordergroup: user.ordergroup)).to be_invalid
|
||||
# expect(FactoryBot.build(:group_order, ordergroup: user.ordergroup)).to be_invalid
|
||||
#end
|
||||
|
||||
#it 'needs an ordergroup' do
|
||||
# expect(FactoryGirl.build(:group_order, order: order)).to be_invalid
|
||||
# expect(FactoryBot.build(:group_order, order: order)).to be_invalid
|
||||
#end
|
||||
|
||||
describe do
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
RSpec.configure do |config|
|
||||
# load FactoryGirl shortcuts create(), etc.
|
||||
config.include FactoryGirl::Syntax::Methods
|
||||
# load FactoryBot shortcuts create(), etc.
|
||||
config.include FactoryBot::Syntax::Methods
|
||||
end
|
||||
|
|
@ -3,7 +3,7 @@ module SessionHelper
|
|||
|
||||
def login(user=nil, password=nil)
|
||||
visit login_path
|
||||
user = FactoryGirl.create :user if user.nil?
|
||||
user = FactoryBot.create :user if user.nil?
|
||||
if user.instance_of? ::User
|
||||
nick, password = user.nick, user.password
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue