Skip to content

Commit

Permalink
Render a consistent git revision during feature tests on about page
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Nov 2, 2023
1 parent 12da417 commit a73ee1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/_tailwind/documentation/about.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@
<p class="mt-8 text-2xl text-navy">
You are using version
<%= pa_link_to APP_VERSION, "https://github.com/openaustralia/planningalerts/commit/#{APP_VERSION}" %>
of PlanningAlerts.
of Planning Alerts.
</p>
5 changes: 5 additions & 0 deletions spec/features/documentation_pages_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
before do
# Give a name to the user so screenshots are consistent with percy
sign_in create(:confirmed_user, tailwind_theme: true, name: "Jane Ng")
stub_const "APP_VERSION", "abc123"
visit about_path
end

Expand All @@ -31,6 +32,10 @@
page.percy_snapshot("About")
end
# rubocop:enable RSpec/NoExpectationExample

it "renders a consistent git revision so screenshots don't change randomly" do
expect(page).to have_content "You are using version abc123 of Planning Alerts"
end
end
end

Expand Down

0 comments on commit a73ee1a

Please sign in to comment.