-
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.
Fix camp application market participation moves, refs #20
- Loading branch information
1 parent
46f85b4
commit e203b6f
Showing
2 changed files
with
54 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
# Copyright (c) 2023-2024, Jungschar EMK. This file is part of | ||
# hitobito_jemk and licensed under the Affero General Public License version 3 | ||
# or later. See the COPYING file at the top-level directory or at | ||
# https://github.com/hitobito/hitobito_jemk. | ||
|
||
Fabricator(:jemk_camp, from: :event, class_name: :'Event::Camp') |
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,46 @@ | ||
# frozen_string_literal: true | ||
|
||
# Copyright (c) 2012-2024, Jungschar EMK. This file is part of | ||
# hitobito_jemk and licensed under the Affero General Public License version 3 | ||
# or later. See the COPYING file at the top-level directory or at | ||
# https://github.com/hitobito/hitobito_jemk. | ||
|
||
require 'spec_helper' | ||
|
||
describe Event::ApplicationMarketController, js: true do | ||
|
||
context 'camp' do | ||
let(:fruela_admin) do | ||
Fabricate(Group::Lagerverein::Administrator.name.to_sym, group: group).person | ||
end | ||
let(:group) { groups(:fruela) } | ||
let(:camp) { Fabricate(:jemk_camp, name: 'FrüLa 2033', groups: [group]) } | ||
|
||
let!(:participation) do | ||
event_application = Event::Application.create!( | ||
priority_1: camp) | ||
|
||
Fabricate(:event_participation, | ||
event: camp, | ||
active: true, | ||
application: event_application) | ||
end | ||
|
||
it 'moves participation from applied to assigned and back' do | ||
sign_in(fruela_admin) | ||
visit group_event_application_market_index_path(group.id, camp.id) | ||
|
||
expect(page).to have_text('FrüLa 2033') | ||
expect(page).to have_css("#applications a", text: participation.person.to_s(:list)) | ||
all("#applications #event_participation_#{participation.id} td").first.find('a').click | ||
expect(page).not_to have_css("#participants a", text: participation.person.to_s(:list)) | ||
|
||
expect(page).to have_css("#participants a", text: participation.person.to_s(:list)) | ||
all("#participants #event_participation_#{participation.id} td").last.find('a').click | ||
|
||
expect(page).not_to have_css("#participants a", text: participation.person.to_s(:list)) | ||
expect(page).to have_css("#applications a", text: participation.person.to_s(:list)) | ||
end | ||
|
||
end | ||
end |