spec/features/text_spec.rb in redditor-0.1.12 vs spec/features/text_spec.rb in redditor-0.1.14
- old
+ new
@@ -21,17 +21,17 @@
add_block
show_text_area
find(".redditor__textarea").set("test text block")
submit
show_text_area
- expect(page.find(".redditor__textarea").value).to have_content "test text block"
+ wait_until { expect(page.find(".redditor__textarea").value).to have_content "test text block" }
end
it "Shows validation error if text block content is empty", type: :feature, js: true do
add_block
submit
- expect(page).to have_content "can't be blank"
+ wait_until { expect(page).to have_content "can't be blank" }
end
it "Deletes text block", type: :feature, js: true do
article.page.text_blocks.build(body: "123", position: 1).save
visit_article
@@ -40,18 +40,18 @@
text_value = begin
page.find("textarea").value
rescue
nil
end
- expect(text_value).to eq nil
+ wait_until { expect(text_value).to eq nil }
end
it "Saves text block to article on save button", type: :feature, js: true do
add_block
show_text_area
page.find("textarea").set("test text block")
save_block
visit_article
show_text_area
- expect(page.find(".redditor__textarea").value).to have_content "test text block"
+ wait_until { expect(page.find(".redditor__textarea").value).to have_content "test text block" }
end
end
\ No newline at end of file