Skip to content

Commit 95c2bc1

Browse files
author
naraesk
authored
Merge pull request #7 from schilbach/master
Continuous Integration,Tests and Deactivation of IP-Logging for Privacy
2 parents e1f2f33 + 326ca03 commit 95c2bc1

94 files changed

Lines changed: 1760 additions & 370 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
before_script:
2+
- cp evaluationserver/config/database.travis.yml evaluationserver/config/database.yml
3+
- "mysql -e 'create database eval_server_test;'"
4+
- cd evaluationserver/
5+
- bundle install
6+
env:
7+
- RAILS_ENV=test
8+
language: ruby
9+
rvm:
10+
- 2.5.0
11+
script:
12+
- bundle exec rails db:migrate RAILS_ENV=test
13+
- bundle exec rspec
14+
after_failure:
15+
- "mysql -e 'show databases;'"
16+
- "cat ./config/database.yml"
17+
- "echo $RAILS_ENV"
18+
- "bundle exec rake --version"

evaluationserver/.gitignore

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,16 @@ public/system/tests/
2020
*.sql
2121
*.log.before
2222
source.sh
23-
.env
23+
.env
24+
25+
db-deployment.yaml
26+
db-service.yaml
27+
web-claim0-persistentvolumeclaim.yaml
28+
web-deployment.yaml
29+
web-env-configmap.yaml
30+
web-service.yaml
31+
coverage
32+
33+
# Ignore encrypted secrets key file.
34+
config/secrets.yml.key
35+
config/initializers/01_env.rb

evaluationserver/.rbenv-gemsets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
evaluationserver

evaluationserver/.rspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--require spec_helper

evaluationserver/.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.5.0

evaluationserver/Gemfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,19 @@ group :development do
5757
gem 'listen'
5858
end
5959

60+
group :development, :test do
61+
gem 'rspec-rails'
62+
gem 'factory_bot'
63+
gem 'factory_bot_rails'
64+
gem 'faker'
65+
gem 'database_cleaner'
66+
gem "i18n-tasks"
67+
gem 'capybara'
68+
gem 'simplecov', require: false
69+
gem 'brakeman', require: false
70+
gem 'capybara-screenshot', :group => :test
71+
end
72+
6073
gem "font-awesome-rails"
6174
gem "therubyracer"
6275
gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS

evaluationserver/Gemfile.lock

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,29 +40,67 @@ GEM
4040
tzinfo (~> 1.1)
4141
acts_as_list (0.9.10)
4242
activerecord (>= 3.0)
43+
addressable (2.5.2)
44+
public_suffix (>= 2.0.2, < 4.0)
4345
arel (8.0.0)
46+
ast (2.4.0)
4447
bootstrap-multiselect-rails4 (0.0.1)
4548
rails (>= 4.0.0)
4649
bootstrap-sass (3.2.0.2)
4750
sass (~> 3.2)
51+
brakeman (4.1.1)
4852
builder (3.2.3)
53+
capybara (2.18.0)
54+
addressable
55+
mini_mime (>= 0.1.3)
56+
nokogiri (>= 1.3.3)
57+
rack (>= 1.0.0)
58+
rack-test (>= 0.5.4)
59+
xpath (>= 2.0, < 4.0)
60+
capybara-screenshot (1.0.19)
61+
capybara (>= 1.0, < 4)
62+
launchy
4963
climate_control (0.2.0)
5064
cocaine (0.5.8)
5165
climate_control (>= 0.0.3, < 1.0)
5266
cocoon (1.2.11)
5367
commonjs (0.2.7)
5468
concurrent-ruby (1.0.5)
5569
crass (1.0.3)
70+
database_cleaner (1.6.2)
71+
diff-lcs (1.3)
72+
docile (1.1.5)
73+
easy_translate (0.5.1)
74+
thread
75+
thread_safe
5676
erubi (1.7.0)
5777
execjs (2.7.0)
78+
factory_bot (4.8.2)
79+
activesupport (>= 3.0.0)
80+
factory_bot_rails (4.8.2)
81+
factory_bot (~> 4.8.2)
82+
railties (>= 3.0.0)
83+
faker (1.8.7)
84+
i18n (>= 0.7)
5885
ffi (1.9.18)
5986
font-awesome-rails (4.7.0.2)
6087
railties (>= 3.2, < 5.2)
6188
globalid (0.4.1)
6289
activesupport (>= 4.2.0)
6390
grease (0.3.1)
91+
highline (1.7.10)
6492
i18n (0.9.1)
6593
concurrent-ruby (~> 1.0)
94+
i18n-tasks (0.9.21)
95+
activesupport (>= 4.0.2)
96+
ast (>= 2.1.0)
97+
easy_translate (>= 0.5.1)
98+
erubi
99+
highline (>= 1.7.3)
100+
i18n
101+
parser (>= 2.2.3.0)
102+
rainbow (>= 2.2.2, < 4.0)
103+
terminal-table (>= 1.5.1)
66104
jbuilder (2.7.0)
67105
activesupport (>= 4.2.0)
68106
multi_json (>= 1.2)
@@ -71,6 +109,8 @@ GEM
71109
railties (>= 4.2.0)
72110
thor (>= 0.14, < 2.0)
73111
json (1.8.6)
112+
launchy (2.4.3)
113+
addressable (~> 2.3)
74114
less (2.6.0)
75115
commonjs (~> 0.2.7)
76116
less-rails (3.0.0)
@@ -110,6 +150,9 @@ GEM
110150
cocaine (~> 0.5.5)
111151
mime-types
112152
mimemagic (= 0.3.0)
153+
parser (2.5.0.5)
154+
ast (~> 2.4.0)
155+
public_suffix (3.0.2)
113156
puma (3.11.0)
114157
rack (2.0.3)
115158
rack-test (0.8.2)
@@ -138,6 +181,7 @@ GEM
138181
method_source
139182
rake (>= 0.8.7)
140183
thor (>= 0.18.1, < 2.0)
184+
rainbow (3.0.0)
141185
rake (12.3.0)
142186
ranked-model (0.4.0)
143187
activerecord (>= 3.1.12)
@@ -146,6 +190,23 @@ GEM
146190
ffi (>= 0.5.0, < 2)
147191
rdoc (4.3.0)
148192
ref (2.0.0)
193+
rspec-core (3.7.1)
194+
rspec-support (~> 3.7.0)
195+
rspec-expectations (3.7.0)
196+
diff-lcs (>= 1.2.0, < 2.0)
197+
rspec-support (~> 3.7.0)
198+
rspec-mocks (3.7.0)
199+
diff-lcs (>= 1.2.0, < 2.0)
200+
rspec-support (~> 3.7.0)
201+
rspec-rails (3.7.2)
202+
actionpack (>= 3.0)
203+
activesupport (>= 3.0)
204+
railties (>= 3.0)
205+
rspec-core (~> 3.7.0)
206+
rspec-expectations (~> 3.7.0)
207+
rspec-mocks (~> 3.7.0)
208+
rspec-support (~> 3.7.0)
209+
rspec-support (3.7.1)
149210
ruby_dep (1.5.0)
150211
rubyzip (1.2.1)
151212
sass (3.5.4)
@@ -162,17 +223,25 @@ GEM
162223
sdoc (0.4.2)
163224
json (~> 1.7, >= 1.7.7)
164225
rdoc (~> 4.0)
226+
simplecov (0.15.1)
227+
docile (~> 1.1.0)
228+
json (>= 1.8, < 3)
229+
simplecov-html (~> 0.10.0)
230+
simplecov-html (0.10.2)
165231
sprockets (3.7.1)
166232
concurrent-ruby (~> 1.0)
167233
rack (> 1, < 3)
168234
sprockets-rails (3.2.1)
169235
actionpack (>= 4.0)
170236
activesupport (>= 4.0)
171237
sprockets (>= 3.0.0)
238+
terminal-table (1.8.0)
239+
unicode-display_width (~> 1.1, >= 1.1.1)
172240
therubyracer (0.12.3)
173241
libv8 (~> 3.16.14.15)
174242
ref
175243
thor (0.20.0)
244+
thread (0.2.2)
176245
thread_safe (0.3.6)
177246
tilt (2.0.8)
178247
tinymce-rails (4.7.4)
@@ -184,9 +253,12 @@ GEM
184253
thread_safe (~> 0.1)
185254
uglifier (4.1.2)
186255
execjs (>= 0.3.0, < 3)
256+
unicode-display_width (1.3.0)
187257
websocket-driver (0.6.5)
188258
websocket-extensions (>= 0.1.0)
189259
websocket-extensions (0.1.3)
260+
xpath (3.0.0)
261+
nokogiri (~> 1.8)
190262

191263
PLATFORMS
192264
ruby
@@ -196,8 +268,16 @@ DEPENDENCIES
196268
acts_as_list
197269
bootstrap-multiselect-rails4
198270
bootstrap-sass (~> 3.2.0)
271+
brakeman
272+
capybara
273+
capybara-screenshot
199274
cocoon
275+
database_cleaner
276+
factory_bot
277+
factory_bot_rails
278+
faker
200279
font-awesome-rails
280+
i18n-tasks
201281
jbuilder
202282
jquery-rails
203283
less-rails
@@ -210,13 +290,15 @@ DEPENDENCIES
210290
rails
211291
rails_serve_static_assets
212292
ranked-model
293+
rspec-rails
213294
rubyzip
214295
sass-rails
215296
sdoc
297+
simplecov
216298
therubyracer
217299
tinymce-rails
218300
turbolinks
219301
uglifier
220302

221303
BUNDLED WITH
222-
1.15.1
304+
1.16.1

evaluationserver/app/controllers/administration_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
class AdministrationController < ApplicationController
22

33
def admin_mode_on
4+
#request.session_options[:skip] = false
45
session[:admin] = true
56
redirect_back(fallback_location: root_path)
67
end
78

89
def admin_mode_off
10+
#request.session_options[:skip] = false
911
session.delete(:admin)
1012
redirect_back(fallback_location: root_path)
1113
end

evaluationserver/app/controllers/application_controller.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class ApplicationController < ActionController::Base
22
# Prevent CSRF attacks by raising an exception.
33
# For APIs, you may want to use :null_session instead.
44
protect_from_forgery with: :exception
5-
5+
66
before_action :set_cache_headers
77

88
CREDENTIALS = {
@@ -44,9 +44,10 @@ def http_basic_authenticate
4444

4545

4646
def set_cache_headers
47-
response.headers["Cache-Control"] = "no-cache, no-store"
48-
response.headers["Pragma"] = "no-cache"
49-
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
47+
#response.headers["Cache-Control"] = "no-cache, no-store"
48+
#response.headers["Pragma"] = "no-cache"
49+
#response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
50+
#request.session_options[:skip] = true unless session[:admin]
5051
end
5152

5253
end

evaluationserver/app/controllers/experiments_controller.rb

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ def start
8080
end
8181

8282
def conduct
83+
if @participant_experiment_step.nil?
84+
render :layout => 'blank', :status => :error, :text => 'No such step'
85+
return
86+
end
87+
88+
8389
unless @participant_experiment_step.experiment_step.step.scenes.empty?
8490

8591

@@ -138,16 +144,6 @@ def import
138144

139145
end
140146

141-
def upload
142-
uploaded_io = params[:experiment_xml]
143-
xml_string = uploaded_io.read
144-
the_experiment = Experiment.create_from_xml(xml_string)
145-
if the_experiment
146-
redirect_to experiment_path(the_experiment)
147-
end
148-
end
149-
150-
151147
def already_done
152148
### TODO: Möglichkeit zum Fortsetzen schaffen
153149
render :layout => 'blank'

0 commit comments

Comments
 (0)