* Removes collective_noun and collective_noun_disabled from app * Config Generalization: replaces community_qualified_name with community_name - Generalizes SiteConfig after the removal of collective_noun field - Updates copy where necessary to be readable with community_name - Makes the community_name SiteConfig description more explicit - Adds flexibility for Admins by removing appended "community" * Adds a data_update script to remove collective_noun and collective_noun_disabled * Removes appended community from stories_controller.rb * Removes unnecessary quotation marks around SiteConfig.community_name.to_s * Makes SiteConfig community_name description more explicit * Removes topic from #email_from and replaces arg with _ * Removes argument from #email_from (facepalm) * Reverts changes to application_mailer and notify_mailer_spec * Removes default "Community" topic from application_mailer and makes topic optional * Refactors #prepopulate_new_form to resolve Code Climate failures * Refactors #email_from even further by use of a ternary operator per review suggestion * Simplifies the data_update script used to remove collective_noun per review request * Adds a data_update script to append community to community_name * Updates data_update script to correctly append Community to community_name * Removes RemoveCollectiveNounFromConfig and updates other script * Removes superfluous false from data_update script * Updates data_update script to be more idiomatic
21 lines
723 B
Ruby
21 lines
723 B
Ruby
require "rails_helper"
|
|
|
|
RSpec.describe "Admin creates new page", type: :system do
|
|
let(:admin) { create(:user, :super_admin) }
|
|
|
|
context "when we pass through a slug param" do
|
|
before do
|
|
sign_in admin
|
|
visit new_admin_page_path(slug: "code-of-conduct")
|
|
end
|
|
|
|
it "will pre-populate the fields correctly" do
|
|
expect(find_field("page[title]").value).to eq("Code of Conduct")
|
|
expect(find_field("page[slug]").value).to eq("code-of-conduct")
|
|
expect(find_field("page[is_top_level_path]").value).to eq("1")
|
|
|
|
text = "All participants of #{community_name} are expected to abide by our Code of Conduct"
|
|
expect(find_field("page[body_html]").value).to include(text)
|
|
end
|
|
end
|
|
end
|