mirror of
https://github.com/discourse/discourse.git
synced 2024-12-20 05:43:47 +08:00
42b1ca8f78
Redesign the permalinks page to follow the UX guide. In addition, the ability to edit permalinks was added. This change includes: - move to RestModel - added Validations - update endpoint and clear old values after the update - system specs and improvements for unit tests
31 lines
949 B
Ruby
31 lines
949 B
Ruby
# frozen_string_literal: true
|
|
|
|
describe "Admin Permalinks Page", type: :system do
|
|
fab!(:admin)
|
|
fab!(:post)
|
|
|
|
let(:admin_permalinks_page) { PageObjects::Pages::AdminPermalinks.new }
|
|
let(:admin_permalink_form_page) { PageObjects::Pages::AdminPermalinkForm.new }
|
|
|
|
before { sign_in(admin) }
|
|
|
|
it "allows admin to create, edit, and destroy permalink" do
|
|
admin_permalinks_page.visit
|
|
admin_permalinks_page.click_add_permalink
|
|
admin_permalink_form_page
|
|
.fill_in_url("test")
|
|
.select_permalink_type("category")
|
|
.fill_in_category("1")
|
|
.click_save
|
|
expect(admin_permalinks_page).to have_permalinks("test")
|
|
|
|
admin_permalinks_page.click_edit_permalink("test")
|
|
admin_permalink_form_page.fill_in_url("test2").click_save
|
|
expect(admin_permalinks_page).to have_permalinks("test2")
|
|
|
|
admin_permalinks_page.click_delete_permalink("test2")
|
|
|
|
expect(admin_permalinks_page).to have_no_permalinks
|
|
end
|
|
end
|