Group show document tests together
While in unit tests it's great to have different tests for different expectations, system tests are slow, and so it's better to have just one test for all the expectations related to the same actions.
This commit is contained in:
@@ -11,22 +11,12 @@ shared_examples "documentable" do |documentable_factory_name, documentable_path,
|
|||||||
end
|
end
|
||||||
|
|
||||||
context "Show documents" do
|
context "Show documents" do
|
||||||
scenario "Download action should be able to anyone" do
|
scenario "Download action should be availabe to anyone and open in a new window" do
|
||||||
visit send(documentable_path, arguments)
|
visit send(documentable_path, arguments)
|
||||||
|
|
||||||
expect(page).to have_link("Download file")
|
expect(page).to have_link "Download file"
|
||||||
end
|
expect(page).to have_selector "a[target=_blank]", text: "Download file"
|
||||||
|
expect(page).to have_selector "a[rel=nofollow]", text: "Download file"
|
||||||
scenario "Download file link should have blank target attribute" do
|
|
||||||
visit send(documentable_path, arguments)
|
|
||||||
|
|
||||||
expect(page).to have_selector("a[target=_blank]", text: "Download file")
|
|
||||||
end
|
|
||||||
|
|
||||||
scenario "Download file links should have rel attribute setted to no follow" do
|
|
||||||
visit send(documentable_path, arguments)
|
|
||||||
|
|
||||||
expect(page).to have_selector("a[rel=nofollow]", text: "Download file")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "Destroy action" do
|
describe "Destroy action" do
|
||||||
|
|||||||
Reference in New Issue
Block a user