Setup I18n for titles
This commit is contained in:
@@ -10,7 +10,7 @@ RSpec.feature "Login", type: :feature do
|
||||
fill_in "Password", with: user.password
|
||||
click_button "Sign in"
|
||||
|
||||
expect(page).not_to have_content("Login")
|
||||
expect(page).not_to have_content(I18n.t("sessions.new.title"))
|
||||
end
|
||||
|
||||
it "should fail to log in the user with an incorrect email address" do
|
||||
@@ -19,7 +19,7 @@ RSpec.feature "Login", type: :feature do
|
||||
fill_in "Password", with: user.password
|
||||
click_button "Sign in"
|
||||
|
||||
expect(page).to have_content("Login")
|
||||
expect(page).to have_content(I18n.t("sessions.new.title"))
|
||||
end
|
||||
|
||||
it "should fail to log in the user with an incorrect password" do
|
||||
@@ -28,7 +28,7 @@ RSpec.feature "Login", type: :feature do
|
||||
fill_in "Password", with: Faker::Internet.unique.password
|
||||
click_button "Sign in"
|
||||
|
||||
expect(page).to have_content("Login")
|
||||
expect(page).to have_content(I18n.t("sessions.new.title"))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -18,7 +18,7 @@ RSpec.feature "Users", type: :feature do
|
||||
it "should not be able to see the user list" do
|
||||
visit users_path
|
||||
|
||||
expect(page).not_to have_content("All users")
|
||||
expect(page).not_to have_content(I18n.t("users.index.title"))
|
||||
end
|
||||
|
||||
it "should be able to create a new contest" do
|
||||
@@ -26,16 +26,16 @@ RSpec.feature "Users", type: :feature do
|
||||
|
||||
click_link "Create a new contest"
|
||||
|
||||
expect(page).to have_content("New jigsaw puzzle competition")
|
||||
expect(page).to have_content(I18n.t("contests.new.title"))
|
||||
end
|
||||
|
||||
it "should be able to open an existing contest" do
|
||||
visit root_path
|
||||
|
||||
expect(page).to have_content(contest.name)
|
||||
find("div.card", text: contest.name).find("a").click()
|
||||
find("div.card", text: contest.name).find("a").click
|
||||
|
||||
expect(page).to have_content("Edit contest")
|
||||
expect(page).to have_content(I18n.t("contests.show.title", name: contest.name))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -56,7 +56,7 @@ RSpec.feature "Users", type: :feature do
|
||||
it "should be able to see the user list" do
|
||||
visit users_path
|
||||
|
||||
expect(page).to have_content("All users")
|
||||
expect(page).to have_content(I18n.t("users.index.title"))
|
||||
expect(page).to have_content(user.username)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user