-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add user research recruitment banner
Trello: https://trello.com/c/yGMU3sR2 This looks reasonable in Firefox on Linux but I need to check on a wider variety of devices before deploying it. We're only showing the banner on the dashboard so that we don't overwhelm people by showing it everywhere. Still to do: - Hide the banner permanently once a user clicks on the "Sign up to take part in research" button. - Allow users to hide the banner for the current session. - Ensure it works and looks correct in all supported browsers.
- Loading branch information
Showing
6 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
app/assets/stylesheets/_user_research_recruitment_banner.scss
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,18 @@ | ||
.user-research-recruitment-banner { | ||
background-color: $govuk-brand-colour; | ||
padding-top: 3em; | ||
} | ||
|
||
.user-research-recruitment-banner__divider { | ||
margin-top: 0; | ||
border-bottom: 1px solid govuk-colour("white"); | ||
} | ||
|
||
.user-research-recruitment-banner__title { | ||
color: govuk-colour("white"); | ||
margin-bottom: 25px; | ||
} | ||
|
||
.user-research-recruitment-banner__intro { | ||
color: govuk-colour("white"); | ||
} |
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,38 @@ | ||
require "test_helper" | ||
|
||
class UserResearchRecruitmentBannerTest < ActionDispatch::IntegrationTest | ||
should "not display the banner on the login page" do | ||
visit new_user_session_path | ||
|
||
assert_not has_content?(user_research_recruitment_banner_title) | ||
end | ||
|
||
should "display the banner on the dashboard" do | ||
user = create(:user, name: "user-name", email: "user@example.com") | ||
visit new_user_session_path | ||
signin_with(user) | ||
|
||
assert has_content?(user_research_recruitment_banner_title) | ||
assert has_link?("Sign up to take part in research", href: "https://docs.google.com/forms/d/1Bdu_GqOrSR4j6mbuzXkFTQg6FRktRMQc8Y-q879Mny8/viewform") | ||
end | ||
|
||
should "not display the banner on any page other than the dashboard" do | ||
user = create(:user, name: "user-name", email: "user@example.com") | ||
visit new_user_session_path | ||
signin_with(user) | ||
|
||
click_on "Change your email or password" | ||
|
||
assert_not has_content?(user_research_recruitment_banner_title) | ||
end | ||
|
||
should "hide the banner until the next session" | ||
|
||
should "hide the banner permanently if the user clicks the button to participate in user research" | ||
|
||
private | ||
|
||
def user_research_recruitment_banner_title | ||
"Help us improve GOV.UK Publishing" | ||
end | ||
end |