-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move navigation delete action to edit page
- Loading branch information
1 parent
c5f80db
commit c7f35f5
Showing
6 changed files
with
76 additions
and
5 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# frozen_string_literal: true | ||
|
||
require "rails_helper" | ||
|
||
RSpec.describe "katalyst/navigation/menu" do | ||
it "can add a menu" do | ||
visit katalyst_navigation.menus_path | ||
|
||
expect(page).to have_text("Title") | ||
|
||
click_on "Add" | ||
|
||
fill_in "Title", with: "Magic" | ||
fill_in "Slug", with: "magic" | ||
|
||
click_on "Create Menu" | ||
|
||
# Menu show page | ||
expect(page).to have_text "Publish" | ||
end | ||
|
||
it "can edit a menu" do | ||
menu = create :katalyst_navigation_menu, title: "Magic", slug: "magic" | ||
|
||
visit katalyst_navigation.menus_path | ||
|
||
expect(page).to have_text("Magic") | ||
|
||
visit katalyst_navigation.edit_menu_path(menu) | ||
|
||
fill_in "Title", with: "Not Magic" | ||
|
||
click_on "save" | ||
|
||
visit katalyst_navigation.menus_path | ||
expect(page).to have_text("Not Magic") | ||
end | ||
|
||
it "can delete a menu" do | ||
menu = create :katalyst_navigation_menu, title: "Magic", slug: "magic" | ||
|
||
visit katalyst_navigation.menus_path | ||
|
||
expect(page).to have_text("Magic") | ||
|
||
visit katalyst_navigation.edit_menu_path(menu) | ||
|
||
click_on "Delete" | ||
|
||
expect(page).not_to have_text("Magic") | ||
end | ||
end |