Commit 11e3e1e8 authored by Alexandre Friquet's avatar Alexandre Friquet

Only enabled performances for subscriptions: refs #88.

parent d5f1b884
......@@ -152,7 +152,7 @@ class SubscriptionsController < ApplicationController
def set_available_performances
collaborating_clubs = Member.of_member_groups(settings.platform_collaborating_clubs)
@available_performances = Performance.where(member_id: collaborating_clubs.ids)
@available_performances = Performance.where(member_id: collaborating_clubs.ids).enabled
end
def notify_clubs_concerned_by_removal(members, removed_performance_ids)
......
......@@ -305,6 +305,7 @@ feature "Manage subscriptions" do
before { login_as_collaborating_club }
let(:athle) { create :activity, title: "Athlétisme" }
let(:swim) { create :activity, title: "Natation" }
context "I can create one", :js do
......@@ -400,6 +401,7 @@ feature "Manage subscriptions" do
perf1 = create :performance, member: main_club, activity: athle
perf2 = create :performance, member: other_club1, activity: athle
perf3 = create :performance, member: other_club2, activity: athle
perf4 = create :performance, member: other_club2, activity: swim, disabled: true
visit new_member_subscription_path(@member)
within "form" do
......@@ -412,6 +414,7 @@ feature "Manage subscriptions" do
check "Collaborating club - [Athlétisme] Lundi"
check "Autre asso 1 - [Athlétisme] Lundi"
check "Autre asso 2 - [Athlétisme] Lundi"
expect(page).not_to have_content "Autre asso 2 - [Natation] Lundi"
expect(page).to have_selector("div#subscription-option", text: "Formule retenue")
click_create_button
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment