Rename document/image fields HTML classes
Using the `document` or `documents` classes meant styles defined for the public list of documents conflict with these ones. So now we're using HTML classes that match the name of the Ruby component classes, as we usually do.
This commit is contained in:
@@ -163,7 +163,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
||||
click_link "Add new document"
|
||||
click_on submit_button
|
||||
|
||||
within "#nested-documents .document" do
|
||||
within "#nested-documents .document-fields" do
|
||||
expect(page).to have_content("can't be blank", count: 2)
|
||||
end
|
||||
end
|
||||
@@ -175,7 +175,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
||||
documentable_attach_new_file(file_fixture("empty.pdf"))
|
||||
click_link "Remove document"
|
||||
|
||||
expect(page).not_to have_css("#nested-documents .document")
|
||||
expect(page).not_to have_css("#nested-documents .document-fields")
|
||||
end
|
||||
|
||||
scenario "Should show successful notice when
|
||||
@@ -248,7 +248,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
||||
do_login_for user_to_login, management: management
|
||||
visit send(path, arguments)
|
||||
|
||||
expect(page).to have_css ".document", count: 1
|
||||
expect(page).to have_css ".document-fields", count: 1
|
||||
end
|
||||
|
||||
scenario "Should not show add document button when
|
||||
@@ -264,7 +264,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
||||
create_list(:document, documentable.class.max_documents_allowed, documentable: documentable)
|
||||
do_login_for user_to_login, management: management
|
||||
visit send(path, arguments)
|
||||
last_document = all("#nested-documents .document").last
|
||||
last_document = all("#nested-documents .document-fields").last
|
||||
within last_document do
|
||||
click_on "Remove document"
|
||||
end
|
||||
@@ -278,7 +278,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
||||
visit send(path, arguments)
|
||||
click_on "Remove document"
|
||||
|
||||
expect(page).not_to have_css ".document"
|
||||
expect(page).not_to have_css ".document-fields"
|
||||
end
|
||||
|
||||
scenario "Same attachment URL after editing the title" do
|
||||
|
||||
@@ -57,7 +57,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p
|
||||
visit send(path, arguments)
|
||||
|
||||
click_link "Add image"
|
||||
input_title = find(".image input[name$='[title]']")
|
||||
input_title = find(".image-fields input[name$='[title]']")
|
||||
fill_in input_title[:id], with: "Title"
|
||||
attach_file "Choose image", file_fixture("clippy.jpg")
|
||||
|
||||
@@ -119,7 +119,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p
|
||||
click_link "Add image"
|
||||
click_on submit_button
|
||||
|
||||
within "#nested-image .image" do
|
||||
within "#nested-image .image-fields" do
|
||||
expect(page).to have_content("can't be blank", count: 2)
|
||||
end
|
||||
end
|
||||
@@ -143,11 +143,11 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p
|
||||
|
||||
imageable_attach_new_file(file_fixture("clippy.jpg"))
|
||||
|
||||
within "#nested-image .image" do
|
||||
within "#nested-image .image-fields" do
|
||||
click_link "Remove image"
|
||||
end
|
||||
|
||||
expect(page).not_to have_selector("#nested-image .image")
|
||||
expect(page).not_to have_selector("#nested-image .image-fields")
|
||||
end
|
||||
|
||||
scenario "Should show successful notice when resource filled correctly without any nested images",
|
||||
@@ -216,7 +216,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p
|
||||
|
||||
visit send(path, arguments)
|
||||
|
||||
expect(page).to have_css ".image", count: 1
|
||||
expect(page).to have_css ".image-fields", count: 1
|
||||
expect(page).not_to have_css "a#new_image_link"
|
||||
end
|
||||
|
||||
@@ -227,7 +227,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p
|
||||
visit send(path, arguments)
|
||||
click_link "Remove image"
|
||||
|
||||
expect(page).not_to have_css ".image"
|
||||
expect(page).not_to have_css ".image-fields"
|
||||
expect(page).to have_link id: "new_image_link"
|
||||
end
|
||||
|
||||
@@ -239,7 +239,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p
|
||||
click_link "Remove image"
|
||||
click_link "Add image"
|
||||
|
||||
expect(page).to have_css ".image", count: 1, visible: :all
|
||||
expect(page).to have_css ".image-fields", count: 1, visible: :all
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user