-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP Rspec passing and seeds working Improve rspec testing
- Loading branch information
Jamie
committed
Jan 26, 2024
1 parent
de648e1
commit 2c63a12
Showing
65 changed files
with
416 additions
and
412 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<h2 class="govuk-heading-m"> | ||
<%= persona.first_name %> | ||
</h2> | ||
<strong class="govuk-tag govuk-tag--<%= type_tag_colour %> govuk-!-margin-bottom-5"> | ||
<%= t(".#{persona.first_name.downcase}.persona_type", default: "") %> | ||
</strong> | ||
<p class="govuk-body"> | ||
<%= t(".#{persona.first_name.downcase}.description", default: "") %> | ||
</p> | ||
|
||
<% if t(".#{persona.first_name.downcase}.roles", default: "").present? %> | ||
<p class="govuk-body"> | ||
<%= t(".roles_include", persona_name: persona.first_name, default: "") %> | ||
</p> | ||
<ul class="govuk-list govuk-list--bullet"> | ||
<% t(".#{persona.first_name.downcase}.roles").each do |role| %> | ||
<li><%= role %></li> | ||
<% end %> | ||
</ul> | ||
<% end %> | ||
|
||
<%= form_tag("/auth/developer/callback", method: "post", data: { turbo: false }) do %> | ||
<%= hidden_field_tag "email", persona.email %> | ||
<%= hidden_field_tag "first_name", persona.first_name %> | ||
<%= hidden_field_tag "last_name", persona.last_name %> | ||
<button type="submit" class="govuk-button govuk-!-margin-bottom-2"> | ||
<%= t(".sign_in_as", persona_name: persona.first_name) %> | ||
</button> | ||
<% end %> | ||
|
||
<hr class="govuk-section-break govuk-section-break--visible govuk-section-break--l"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class PersonaSignInComponent < ApplicationComponent | ||
attr_reader :persona | ||
|
||
def initialize(persona, classes: [], html_attributes: {}) | ||
super(classes:, html_attributes:) | ||
|
||
@persona = persona | ||
end | ||
|
||
def type_tag_colour | ||
case persona.first_name | ||
when "Anne" | ||
"purple" | ||
when "Patricia" | ||
"orange" | ||
when "Mary" | ||
"yellow" | ||
when "Colin" | ||
"blue" | ||
else | ||
"turquoise" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# == Schema Information | ||
# | ||
# Table name: users | ||
# | ||
# id :uuid not null, primary key | ||
# email :string not null | ||
# first_name :string not null | ||
# last_name :string not null | ||
# type :string | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# | ||
# Indexes | ||
# | ||
# index_users_on_type_and_email (type,email) UNIQUE | ||
# | ||
class Claims::SupportUser < User | ||
def is_support_user? | ||
true | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.