Browse Source

dealt with hardcoded name

cucumber-rails
JG 3 years ago
parent
commit
fcf01a3496
  1. 2
      spec/factories/user.rb
  2. 2
      spec/helpers/tab_nav_helper_spec.rb

2
spec/factories/user.rb

@ -1,7 +1,7 @@
FactoryBot.define do
factory :user do
sequence(:email) { |i| "test#{i}@example.com" }
name { "Danny Rojas" }
name { Faker::Name.name }
password { "pAssword1" }
organisation
role { "data_provider" }

2
spec/helpers/tab_nav_helper_spec.rb

@ -6,7 +6,7 @@ RSpec.describe TabNavHelper do
describe "#user_cell" do
it "returns user link and email separated by a newline character" do
expected_html = "<a class=\"govuk-link govuk-!-font-weight-bold\" href=\"/users\">Danny Rojas</a>\n#{user.email}"
expected_html = "<a class=\"govuk-link govuk-!-font-weight-bold\" href=\"/users\">#{user.name}</a>\n#{user.email}"
expect(user_cell(user)).to match(expected_html)
end
end

Loading…
Cancel
Save