-
-
Notifications
You must be signed in to change notification settings - Fork 250
/
setup-super-scaffolding-system-test
executable file
·109 lines (92 loc) · 4.89 KB
/
setup-super-scaffolding-system-test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/usr/bin/env bash
export SPRING=true
if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "0" ]; then
bin/super-scaffold crud TestSite Team name:text_field other_attribute:text_field url:text_field --navbar="ti-world" --sortable
bin/super-scaffold crud TestPage TestSite,Team name:text_field path:text_field
bin/super-scaffold crud-field TestSite membership_id:super_select{class_name=Membership}
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i "" "s/raise .*/team\.memberships/g" app/models/test_site.rb
else
sed -i "s/raise .*/team\.memberships/g" app/models/test_site.rb
fi
else
echo "Skipping \`TestSite\` and \`TestPage\` on this CI node."
fi
if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "1" ]; then
bin/super-scaffold crud Project Team name:text_field description:trix_editor --navbar="ti-layout"
bin/super-scaffold crud Projects::Deliverable Project,Team name:text_field description:trix_editor
# Setup for has-many-through test.
bin/super-scaffold crud Projects::Tag Team name:text_field --navbar="ti-tag"
bin/super-scaffold join-model Projects::AppliedTag project_id{class_name=Project} tag_id{class_name=Projects::Tag}
bin/super-scaffold crud-field Project tag_ids:super_select{class_name=Projects::Tag}
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i "" "s/raise .*/team\.projects_tags/g" app/models/project.rb
else
sed -i "s/raise .*/team\.projects_tags/g" app/models/project.rb
fi
else
echo "Skipping \`Project\` and \`Projects::Deliverable\` on this CI node."
fi
if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "2" ]; then
bin/super-scaffold crud Projects::Step Team name:text_field description:trix_editor --navbar="ti-world"
bin/super-scaffold crud Objective Projects::Step,Team name:text_field description:trix_editor
else
echo "Skipping \`Projects::Step\` and \`Objective\` on this CI node."
fi
if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "3" ]; then
bin/super-scaffold crud Insight Team name:text_field description:trix_editor --navbar="ti-world"
bin/super-scaffold crud Personality::CharacterTrait Insight,Team name:text_field description:trix_editor
else
echo "Skipping \`Insight\` and \`Personality::CharacterTrait\` on this CI node."
fi
if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "4" ]; then
bin/super-scaffold crud Personality::Disposition Team name:text_field description:trix_editor --navbar="ti-world"
bin/super-scaffold crud Personality::Note Personality::Disposition,Team name:text_field description:trix_editor
# Test that the foreign key table name will be inserted into the migration.
bin/super-scaffold crud-field Personality::Note other_membership_id:super_select{class_name=Membership}
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i "" "s/raise .*/team\.memberships/g" app/models/personality/note.rb
else
sed -i "s/raise .*/team\.memberships/g" app/models/personality/note.rb
fi
else
echo "Skipping \`Personality::Disposition\` and \`Personality::Note\` on this CI node."
fi
if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "5" ]; then
bin/super-scaffold crud Personality::Observation Team name:text_field description:trix_editor --navbar="ti-world"
bin/super-scaffold crud Personality::Reactions::Response Personality::Observation,Team name:text_field description:trix_editor
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i "" "s/\@response/\@response_object/g" test/controllers/api/v1/personality/reactions/responses_controller_test.rb
else
sed -i "s/\@response/\@response_object/g" test/controllers/api/v1/personality/reactions/responses_controller_test.rb
fi
else
echo "Skipping \`Personality::Observation\` and \`Personality::Reactions::Response\` on this CI node."
fi
if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "6" ]; then
bin/super-scaffold crud TestFile Team name:text_field foo:file_field bars:file_field{multiple} --navbar="ti-tag"
bin/super-scaffold crud ColorPicker Team color_picker_value:color_picker --navbar="ti-tag"
else
echo "Skipping \`TestFile\` and \`ColorPicker\` on this CI node."
fi
# TODO: Generate these in parallel.
bin/super-scaffold crud PartialTest Team \
text_field_test:text_field \
boolean_test:boolean \
single_button_test:buttons \
multiple_buttons_test:buttons{multiple} \
date_test:date_field\
date_time_test:date_and_time_field \
file_test:file_field \
option_test:options \
multiple_options_test:options{multiple} \
password_test:password_field \
phone_field_test:phone_field \
super_select_test:super_select \
multiple_super_select_test:super_select{multiple} \
number_field_test:number_field \
text_area_test:text_area \
address_test:address_field --navbar="ti-layout"
# The test for this webhook is run inline in .circleci/config.yml.
bin/super-scaffold incoming-webhooks SomeProvider
bundle exec spring rake db:schema:load db:migrate db:test:prepare