Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix editing sites #1891

Merged
merged 1 commit into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/views/alchemy/admin/sites/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= alchemy_form_for site, url: alchemy.admin_sites_path(site, search_filter_params) do |f| %>
<%= alchemy_form_for site, url: resource_path(site, search_filter_params) do |f| %>
<%= f.input :host, hint: resource_handler.help_text_for(name: :host)&.html_safe %>
<%= f.input :name %>
<%= f.input :public %>
Expand Down
19 changes: 19 additions & 0 deletions spec/features/admin/site_editing_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

require "rails_helper"

RSpec.describe "Site editing feature", type: :system do
before { authorize_user(:as_admin) }

it "can create a new page" do
visit alchemy.new_admin_site_path
fill_in "site_host", with: "api.example.com"
fill_in "site_name", with: "API Site"
click_button "Save"
expect(page).to have_content "You need at least one language to work with. Please create one below."
visit alchemy.edit_admin_site_path(Alchemy::Site.first)
fill_in "Aliases", with: "api.localhost"
click_button "Save"
expect(page).to have_content "api.localhost"
end
end