Fix line lenght issues on spec files
This commit is contained in:
@@ -56,13 +56,14 @@ shared_examples "followable" do |followable_class_name, followable_path, followa
|
|||||||
scenario "Should display new follower notice after user clicks on follow button", :js do
|
scenario "Should display new follower notice after user clicks on follow button", :js do
|
||||||
user = create(:user)
|
user = create(:user)
|
||||||
login_as(user)
|
login_as(user)
|
||||||
|
create_notice_message = t("shared.followable.#{followable_class_name}.create.notice_html")
|
||||||
|
|
||||||
visit send(followable_path, arguments)
|
visit send(followable_path, arguments)
|
||||||
within "##{dom_id(followable)}" do
|
within "##{dom_id(followable)}" do
|
||||||
click_link("Follow #{followable.model_name.human.downcase}")
|
click_link("Follow #{followable.model_name.human.downcase}")
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(page).to have_content strip_tags(t("shared.followable.#{followable_class_name}.create.notice_html"))
|
expect(page).to have_content strip_tags(notice_html_message)
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "Display unfollow button when user already following" do
|
scenario "Display unfollow button when user already following" do
|
||||||
@@ -75,7 +76,7 @@ shared_examples "followable" do |followable_class_name, followable_path, followa
|
|||||||
expect(page).to have_link("Following")
|
expect(page).to have_link("Following")
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "Should update follow button and show destroy notice after user clicks on unfollow button", :js do
|
scenario "Updates follow button & show destroy notice after unfollow button is clicked", :js do
|
||||||
user = create(:user)
|
user = create(:user)
|
||||||
follow = create(:follow, user: user, followable: followable)
|
follow = create(:follow, user: user, followable: followable)
|
||||||
login_as(user)
|
login_as(user)
|
||||||
@@ -93,13 +94,14 @@ shared_examples "followable" do |followable_class_name, followable_path, followa
|
|||||||
user = create(:user)
|
user = create(:user)
|
||||||
follow = create(:follow, user: user, followable: followable)
|
follow = create(:follow, user: user, followable: followable)
|
||||||
login_as(user)
|
login_as(user)
|
||||||
|
destroy_notice_message = t("shared.followable.#{followable_class_name}.destroy.notice_html")
|
||||||
|
|
||||||
visit send(followable_path, arguments)
|
visit send(followable_path, arguments)
|
||||||
within "##{dom_id(followable)}" do
|
within "##{dom_id(followable)}" do
|
||||||
click_link("Unfollow #{followable.model_name.human.downcase}")
|
click_link("Unfollow #{followable.model_name.human.downcase}")
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(page).to have_content strip_tags(t("shared.followable.#{followable_class_name}.destroy.notice_html"))
|
expect(page).to have_content strip_tags(destroy_notice_message)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -69,8 +69,9 @@ shared_examples "acts as imageable" do |imageable_factory|
|
|||||||
it "image destroy should remove image from file storage" do
|
it "image destroy should remove image from file storage" do
|
||||||
image.save
|
image.save
|
||||||
image_url = image.attachment.url
|
image_url = image.attachment.url
|
||||||
|
new_url = '/attachments/original/missing.png'
|
||||||
|
|
||||||
expect{ image.attachment.destroy }.to change{ image.attachment.url }.from(image_url).to("/attachments/original/missing.png")
|
expect{ image.attachment.destroy }.to change{ image.attachment.url }.from(image_url).to(new_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -34,9 +34,10 @@ shared_examples "document validations" do |documentable_factory|
|
|||||||
|
|
||||||
it "is not valid for attachments larger than documentable max_file_size definition" do
|
it "is not valid for attachments larger than documentable max_file_size definition" do
|
||||||
document.stub(:attachment_file_size).and_return(maxfilesize.megabytes + 1.byte)
|
document.stub(:attachment_file_size).and_return(maxfilesize.megabytes + 1.byte)
|
||||||
|
max_size_error_message = "must be in between 0 Bytes and #{maxfilesize} MB"
|
||||||
|
|
||||||
expect(document).not_to be_valid
|
expect(document).not_to be_valid
|
||||||
expect(document.errors[:attachment]).to include "must be in between 0 Bytes and #{maxfilesize} MB"
|
expect(document.errors[:attachment]).to include max_size_error_message
|
||||||
end
|
end
|
||||||
|
|
||||||
it "is not valid without a user_id" do
|
it "is not valid without a user_id" do
|
||||||
@@ -59,4 +60,4 @@ shared_examples "document validations" do |documentable_factory|
|
|||||||
expect(document).not_to be_valid
|
expect(document).not_to be_valid
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user