Flaky Spec Fix: Ensure submit requests finish before checking status of user (#5265)
This commit is contained in:
parent
09e5ad5c0c
commit
39033e33d9
4 changed files with 7 additions and 3 deletions
|
|
@ -8,7 +8,7 @@ RSpec.describe MediumArticleRetrievalService, type: :service, vcr: {} do
|
|||
author_image: "https://miro.medium.com/fit/c/96/96/1*qFzi921ix0_kkrFMKYgELw.jpeg",
|
||||
reading_time: "4 min read",
|
||||
published_time: "2018-11-03T09:44:32.733Z",
|
||||
publication_date: "Nov 3, 2018",
|
||||
publication_date: anything,
|
||||
url: "https://medium.com/@edisonywh/my-ruby-journey-hooking-things-up-91d757e1c59c"
|
||||
}
|
||||
end
|
||||
|
|
@ -20,7 +20,7 @@ RSpec.describe MediumArticleRetrievalService, type: :service, vcr: {} do
|
|||
VCR.use_cassette("medium") do
|
||||
html = HTTParty.get(medium_url)
|
||||
stub_request(:get, medium_url).to_return(body: html.body, status: 200)
|
||||
expect(described_class.call(medium_url)).to eq(expected_response)
|
||||
expect(described_class.call(medium_url)).to include(expected_response)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ require "webdrivers/chromedriver"
|
|||
|
||||
Webdrivers.cache_time = 86_400
|
||||
|
||||
Capybara.default_max_wait_time = 5
|
||||
Capybara.default_max_wait_time = 10
|
||||
|
||||
Capybara.register_driver :headless_chrome do |app|
|
||||
options = Selenium::WebDriver::Chrome::Options.new(
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ RSpec.describe "Admin bans user", type: :system do
|
|||
select("Ban", from: "user_user_status")
|
||||
fill_in("user_note_for_current_role", with: "something")
|
||||
click_button("Update User Status")
|
||||
expect(page).to have_content("User has been updated")
|
||||
end
|
||||
|
||||
def warn_user
|
||||
|
|
@ -21,6 +22,7 @@ RSpec.describe "Admin bans user", type: :system do
|
|||
select("Warn", from: "user_user_status")
|
||||
fill_in("user_note_for_current_role", with: "something")
|
||||
click_button("Update User Status")
|
||||
expect(page).to have_content("User has been updated")
|
||||
end
|
||||
|
||||
def add_tag_moderator_role
|
||||
|
|
@ -33,6 +35,7 @@ RSpec.describe "Admin bans user", type: :system do
|
|||
select("Regular Member", from: "user_user_status")
|
||||
fill_in("user_note_for_current_role", with: "good user")
|
||||
click_button("Update User Status")
|
||||
expect(page).to have_content("User has been updated")
|
||||
end
|
||||
|
||||
it "checks that the user is warned, has a note, and privileges are removed" do
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ RSpec.describe "Looking For Work" do
|
|||
perform_enqueued_jobs do
|
||||
click_button("SUBMIT")
|
||||
end
|
||||
expect(page).to have_text("Your profile was successfully updated")
|
||||
expect(user.follows.count).to eq(1)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue