Flaky Spec Fix: Set Profile Image to Nil to Avoid Server Errors in js Specs (#8350)

This commit is contained in:
Molly Struve 2020-06-09 08:48:21 -05:00 committed by GitHub
parent a6b0c1082c
commit a5f6183554
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View file

@ -49,7 +49,7 @@ before_install:
- sudo systemctl start elasticsearch
install:
- bundle config set path 'vendor/bundle'
- bundle install --local --jobs 2
- bundle install --local --jobs=2
- yarn install --frozen-lockfile
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
> ./cc-test-reporter

View file

@ -5,7 +5,7 @@ RSpec.describe "User visits articles by tag", type: :system do
let(:iot_tag) { create(:tag, name: "IoT") }
let!(:func_tag) { create(:tag, name: "functional") }
let(:author) { create(:user) }
let(:author) { create(:user, profile_image: nil) }
let!(:article) { create(:article, tags: "javascript, IoT", user: author, published_at: 2.days.ago, score: 5) }
let!(:article2) { create(:article, tags: "functional", user: author, published_at: Time.current, score: 5) }
let!(:article3) { create(:article, tags: "functional, javascript", user: author, published_at: 2.weeks.ago, score: 5) }

View file

@ -1,8 +1,8 @@
require "rails_helper"
RSpec.describe "User visits a homepage", type: :system do
let!(:article) { create(:article, reactions_count: 12, featured: true) }
let!(:article2) { create(:article, reactions_count: 20, featured: true) }
let!(:article) { create(:article, reactions_count: 12, featured: true, user: create(:user, profile_image: nil)) }
let!(:article2) { create(:article, reactions_count: 20, featured: true, user: create(:user, profile_image: nil)) }
let!(:timestamp) { "2019-03-04T10:00:00Z" }
context "when no options specified" do