Skip to content

Commit

Permalink
add checks to access_code_groups_spec
Browse files Browse the repository at this point in the history
  • Loading branch information
ElviaBth committed Apr 10, 2024
1 parent 5cd407d commit 8d81df7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 2 additions & 8 deletions spec/controller/admin/codes_groups_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,9 @@ module Admin
end

describe "GET #index" do
it "assigns @groups and renders the index template" do
group = Decidim::AnonymousCodes::Group.create(
title: "Sample Group",
expires_at: 1.day.from_now,
active: true,
max_reuses: 10,
organization: current_organization
)
let!(:group) { create(:anonymous_codes_group, expires_at: 1.day.from_now, active: true, max_reuses: 10, organization: current_organization) }

it "assigns @groups and renders the index template" do
get :index
expect(assigns(:groups)).to eq([group])
expect(response).to render_template("index")
Expand Down
2 changes: 2 additions & 0 deletions spec/system/admin/access_code_groups_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

expect(page).to have_content("Access code group successfully created")
expect(page).to have_content("New access code group")
last_group = Decidim::AnonymousCodes::Group.last
expect(last_group.title["en"]).to eq("New Group")

click_link "Edit"
fill_in_i18n(
Expand Down

0 comments on commit 8d81df7

Please sign in to comment.