docbrown/spec/system/admin/admin_creates_new_page_spec.rb
Julianna Tetreault aa7ef577cb
Adds a Default Color Hex Value to the Admin Tags Color Field (#11105) [deploy]
* Adds a default color hex value to the /admin/tags/show color picker

* Rebased against color-picker changes and adds default color to edit.html.erb

* Adds a system spec for admin/tags and adjusts the filename for admin_creates_new_page_spec

* Uses .blank? in place of .nil? in admin/tags/show.html.erb

* Refactors test in admin_updates_tag_spec.rb
2020-11-02 12:50:03 -07:00

21 lines
737 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 the #{community_qualified_name} are expected to abide by our Code of Conduct"
expect(find_field("page[body_html]").value).to include(text)
end
end
end