Skip to content

Commit c8fbb91

Browse files
committed
Harden picture descriptions integration spec
The spec makes assumptions about the picture record and its related objects. Since those have been mutated by the server process that rspec spawns for feature specs, we need to reload the records before trying to make any assertions on the in-memory objects. (cherry picked from commit faaeaff)
1 parent 219d5f5 commit c8fbb91

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

spec/features/admin/picture_library_integration_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@
9999
select(language.language_code.upcase, from: "Language")
100100
expect(page).to have_field("Description", with: "This is an amazing image.")
101101

102+
# Make sure we have the latest records before making assumptions
103+
picture.descriptions.reload
104+
102105
expect(picture.descriptions.size).to eq(2)
103106
expect(picture.descriptions.find_by(language: german).text).to eq("Tolles Bild.")
104107
expect(picture.descriptions.find_by(language: language).text).to eq("This is an amazing image.")

0 commit comments

Comments
 (0)