Commit d949c00b8aa7ce39daa19e2e39cd4b856840a125
1 parent
24d0dec6
Exists in
master
and in
1 other branch
fixes #910 force env_vars to always be a hash
Showing
2 changed files
with
16 additions
and
1 deletions
Show diff stats
app/models/notice.rb
spec/models/notice_spec.rb
@@ -105,4 +105,18 @@ describe Notice, type: 'model' do | @@ -105,4 +105,18 @@ describe Notice, type: 'model' do | ||
105 | expect(notice.request).to eq ({}) | 105 | expect(notice.request).to eq ({}) |
106 | end | 106 | end |
107 | end | 107 | end |
108 | + | ||
109 | + describe "env_vars" do | ||
110 | + it "returns the cgi-data" do | ||
111 | + notice = Notice.new | ||
112 | + notice.request = { 'cgi-data' => { 'ONE' => 'TWO' } } | ||
113 | + expect(notice.env_vars).to eq({ 'ONE' => 'TWO' }) | ||
114 | + end | ||
115 | + | ||
116 | + it "always returns a hash" do | ||
117 | + notice = Notice.new | ||
118 | + notice.request = { 'cgi-data' => [] } | ||
119 | + expect(notice.env_vars).to eq({}) | ||
120 | + end | ||
121 | + end | ||
108 | end | 122 | end |