File tree Expand file tree Collapse file tree
spec/domain/export/tabular/people Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88require "spec_helper"
99
1010describe Export ::Tabular ::People ::ParticipationsList do
11- let ( :event ) { events ( :top_course ) }
12- let ( :participation ) { event_participations ( :top_participant ) }
11+ let ( :event ) { participation . event }
12+ let ( :participation ) { event_participations ( :top_leader ) }
13+ let ( :ability ) { Ability . new ( participation . person ) }
14+
15+ subject ( :attribute_labels ) { described_class . new ( [ participation ] , ability ) . attribute_labels }
1316
1417 describe "attribute_labels" do
1518 it "contains keys and translated labels" do
16- attribute_labels = described_class . new ( [ participation ] ) . attribute_labels
17-
18- expect ( attribute_labels ) . to eq (
19+ expect ( attribute_labels ) . to include (
1920 {
2021 first_name : "Vorname" ,
2122 last_name : "Nachname" ,
2829 end
2930
3031 context "event with question" do
31- let ( :question ) {
32- Fabricate ( :event_question , event : event , question : "Vegi?" )
33- }
34-
3532 it "contains questions" do
36- participation . answers . create! question : question , answer : "Ja"
37-
38- attribute_labels = described_class . new ( [ participation ] ) . attribute_labels
39-
33+ question = Fabricate ( :event_question , event : event , question : "Vegi?" )
34+ expect ( question . event ) . to eq participation . event
35+ participation . answers . find_by ( question :) . update! ( answer : "Ja" )
4036 expect ( attribute_labels [ :"question_#{ question . id } " ] ) . to eq ( "Vegi?" )
4137 end
4238 end
You can’t perform that action at this time.
0 commit comments