Upgrade factory_bot_rails to 5.2.0 (#2532) [ci skip]

This commit is contained in:
rhymes 2019-04-23 19:21:22 +02:00 committed by Mac Siri
parent 794c2790f7
commit 9d2c89fd2f
8 changed files with 13 additions and 13 deletions

View file

@ -133,7 +133,7 @@ end
group :test do
gem "approvals", "~> 0.0" # A library to make it easier to do golden-master style testing in Ruby
gem "factory_bot_rails", "~> 4.11" # factory_bot is a fixtures replacement with a straightforward definition syntax, support for multiple build strategies
gem "factory_bot_rails", "~> 5.0" # factory_bot is a fixtures replacement with a straightforward definition syntax, support for multiple build strategies
gem "launchy", "~> 2.4" # Launchy is helper class for launching cross-platform applications in a fire and forget manner.
gem "pundit-matchers", "~> 1.6" # A set of RSpec matchers for testing Pundit authorisation policies
gem "rspec-retry", "~> 0.6" # retry intermittently failing rspec examples

View file

@ -307,11 +307,11 @@ GEM
eventmachine (1.2.5)
excon (0.60.0)
execjs (2.7.0)
factory_bot (4.11.1)
activesupport (>= 3.0.0)
factory_bot_rails (4.11.1)
factory_bot (~> 4.11.1)
railties (>= 3.0.0)
factory_bot (5.0.2)
activesupport (>= 4.2.0)
factory_bot_rails (5.0.2)
factory_bot (~> 5.0.2)
railties (>= 4.2.0)
faker (1.9.3)
i18n (>= 0.7)
faraday (0.15.4)
@ -997,7 +997,7 @@ DEPENDENCIES
emoji_regex (~> 1.0)
envied (~> 0.9)
erb_lint (~> 0.0)
factory_bot_rails (~> 4.11)
factory_bot_rails (~> 5.0)
faker (~> 1.9)
fastly (~> 1.15)
fastly-rails (~> 0.8)

View file

@ -13,7 +13,7 @@ FactoryBot.define do
with_tweet_tag { false }
with_title { true }
end
user
association :user, factory: :user, strategy: :create
description { Faker::Hipster.paragraph(1)[0..100] }
main_image { Faker::Avatar.image }
language { "en" }

View file

@ -3,7 +3,7 @@ require "rails_helper"
RSpec.describe Article, type: :model do
def build_and_validate_article(*args)
article = build(:article, *args)
article.validate
article.validate!
article
end

View file

@ -20,7 +20,7 @@ RSpec.describe ApiSecretPolicy do
end
context "when user does not own the secret" do
let(:user) { build(:user) }
let(:user) { create(:user) }
it { is_expected.to permit_actions %i[create] }
it { is_expected.to forbid_actions %i[destroy] }

View file

@ -17,7 +17,7 @@ RSpec.describe ArticlePolicy do
end
context "when user is not the author" do
let(:user) { build(:user) }
let(:user) { create(:user) }
it { is_expected.to permit_actions(%i[new create preview]) }
it { is_expected.to forbid_actions(%i[update delete_confirm destroy]) }

View file

@ -20,7 +20,7 @@ RSpec.describe CommentPolicy do
end
context "when user is not the author" do
let(:user) { build(:user) }
let(:user) { create(:user) }
it { is_expected.to permit_actions(%i[create]) }
it { is_expected.to forbid_actions(%i[edit update destroy delete_confirm]) }

View file

@ -13,7 +13,7 @@ RSpec.describe GithubRepoPolicy do
end
context "when user is not the owner" do
let(:user) { build(:user) }
let(:user) { create(:user) }
it { is_expected.to permit_actions(%i[create]) }
it { is_expected.to forbid_actions(%i[update]) }