File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed
app/views/alchemy/admin/pages Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 1515 </ div >
1616 < div class ="value ">
1717 < label > <%= Alchemy ::Page . human_attribute_name ( :urlname ) %> </ label >
18- < p > <%= "/ #{ @page . urlname } " %> </ p >
18+ < p > <%= @page . url_path %> </ p >
1919 </ div >
2020 < div class ="value ">
2121 < label > <%= Alchemy . t ( :page_status ) %> </ label >
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ require "rails_helper"
4+
5+ RSpec . describe "Show page info feature" , type : :system do
6+ let ( :alchemy_page ) { create ( :alchemy_page ) }
7+
8+ context "as anonymous user" do
9+ it "redirects to login page" do
10+ visit alchemy . info_admin_page_path ( alchemy_page )
11+ expect ( page ) . to have_current_path ( Alchemy . login_path )
12+ end
13+ end
14+
15+ context "as author" do
16+ before do
17+ authorize_user ( :as_author )
18+ expect_any_instance_of ( Alchemy ::Page ) . to receive ( :url_path ) { "/en/page-urlname" }
19+ end
20+
21+ it "shows page info dialog" , :aggregate_failures do
22+ visit alchemy . info_admin_page_path ( alchemy_page )
23+
24+ within ".resource_info" do
25+ expect ( page ) . to have_content ( "Page type Standard" )
26+ expect ( page ) . to have_content ( "URL-Path /en/page-urlname" )
27+ expect ( page ) . to have_content ( "Status Page is unavailable for website visitors. Page is accessible by all visitors." )
28+ expect ( page ) . to have_content ( "Was created from unknown at " + I18n . l ( alchemy_page . created_at , format : :"alchemy.page_status" ) )
29+ expect ( page ) . to have_content ( "Was updated from unknown at " + I18n . l ( alchemy_page . updated_at , format : :"alchemy.page_status" ) )
30+ end
31+ end
32+ end
33+ end
You can’t perform that action at this time.
0 commit comments