-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create new basic tab for admin information texts
- Loading branch information
Showing
8 changed files
with
76 additions
and
16 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
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
2 changes: 1 addition & 1 deletion
2
app/views/admin/site_customization/information_texts/_tabs.html.erb
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
34 changes: 34 additions & 0 deletions
34
spec/features/site_customization/information_texts_spec.rb
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,34 @@ | ||
require "rails_helper" | ||
|
||
feature "Custom information texts" do | ||
|
||
scenario "Show custom texts instead of default ones" do | ||
admin = create(:administrator) | ||
login_as(admin.user) | ||
|
||
debate_key = "debates.index.section_footer.title" | ||
proposal_key = "proposals.index.section_footer.title" | ||
|
||
visit admin_site_customization_information_texts_path(tab: "debates") | ||
fill_in "contents[content_#{debate_key}]values[value_en]", with: "Custom help about debates" | ||
click_button "Save" | ||
|
||
visit admin_site_customization_information_texts_path(tab: "proposals") | ||
fill_in "contents[content_#{proposal_key}]values[value_en]", with: "Custom help about proposals" | ||
click_button "Save" | ||
|
||
visit debates_path | ||
|
||
within("#section_help") do | ||
expect(page).to have_content "Custom help about debates" | ||
expect(page).not_to have_content "Help about debates" | ||
end | ||
|
||
visit proposals_path | ||
|
||
within("#section_help") do | ||
expect(page).to have_content "Custom help about proposals" | ||
expect(page).not_to have_content "Help about proposals" | ||
end | ||
end | ||
end |