diff --git a/spec/controller/admin/codes_groups_controller_spec.rb b/spec/controller/admin/codes_groups_controller_spec.rb index 76ce4d7..b54d19e 100644 --- a/spec/controller/admin/codes_groups_controller_spec.rb +++ b/spec/controller/admin/codes_groups_controller_spec.rb @@ -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") diff --git a/spec/system/admin/access_code_groups_spec.rb b/spec/system/admin/access_code_groups_spec.rb index 5aa77a1..0e3d27b 100644 --- a/spec/system/admin/access_code_groups_spec.rb +++ b/spec/system/admin/access_code_groups_spec.rb @@ -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(