Skip to content

Commit

Permalink
[add] spec about destroy all
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny4381 committed Jan 28, 2021
1 parent 9adbf2f commit e74df5c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions spec/features/sys/sites_spec.rb
Expand Up @@ -124,4 +124,27 @@
end
end
end

describe "destroy all", js: true do
let!(:site1) { create(:sys_site, name: unique_id, host: unique_id, domains: unique_domain) }
let!(:site2) { create(:sys_site, name: unique_id, host: unique_id, domains: unique_domain) }

before { login_sys_user }

it do
expect(SS::Site.all.count).to eq 2

visit sys_sites_path

within ".list-head" do
first("[type='checkbox']").click
page.accept_confirm do
click_on I18n.t("ss.links.delete")
end
end
expect(page).to have_css('#notice', text: I18n.t("ss.notice.deleted"))

expect(SS::Site.all.count).to eq 0
end
end
end

0 comments on commit e74df5c

Please sign in to comment.