upgrade and force html responses
This commit is contained in:
@@ -12,7 +12,7 @@ group :assets do
|
|||||||
gem 'coffee-script'
|
gem 'coffee-script'
|
||||||
#gem 'therubyracer', :platforms => :ruby
|
#gem 'therubyracer', :platforms => :ruby
|
||||||
#gem 'less-rails'
|
#gem 'less-rails'
|
||||||
gem 'foundation-rails'
|
gem 'foundation-rails', '~> 5.5'
|
||||||
gem 'ace-rails-ap'
|
gem 'ace-rails-ap'
|
||||||
gem "jquery-rails"
|
gem "jquery-rails"
|
||||||
gem 'font-awesome-rails'
|
gem 'font-awesome-rails'
|
||||||
|
|||||||
+109
-103
@@ -13,7 +13,7 @@ GIT
|
|||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/bterkuile/simply_stored.git
|
remote: git://github.com/bterkuile/simply_stored.git
|
||||||
revision: 0941952120c7fbb3c7a38486cd26d9380fb657aa
|
revision: 95e045e1ed073090505596d74c6f1d3f39ef4729
|
||||||
specs:
|
specs:
|
||||||
simply_stored (1.0.0)
|
simply_stored (1.0.0)
|
||||||
activesupport
|
activesupport
|
||||||
@@ -38,50 +38,51 @@ PATH
|
|||||||
GEM
|
GEM
|
||||||
remote: http://rubygems.org/
|
remote: http://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
ace-rails-ap (4.0.0)
|
ace-rails-ap (4.0.2)
|
||||||
actionmailer (4.2.4)
|
actionmailer (4.2.6)
|
||||||
actionpack (= 4.2.4)
|
actionpack (= 4.2.6)
|
||||||
actionview (= 4.2.4)
|
actionview (= 4.2.6)
|
||||||
activejob (= 4.2.4)
|
activejob (= 4.2.6)
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||||
actionpack (4.2.4)
|
actionpack (4.2.6)
|
||||||
actionview (= 4.2.4)
|
actionview (= 4.2.6)
|
||||||
activesupport (= 4.2.4)
|
activesupport (= 4.2.6)
|
||||||
rack (~> 1.6)
|
rack (~> 1.6)
|
||||||
rack-test (~> 0.6.2)
|
rack-test (~> 0.6.2)
|
||||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||||
actionview (4.2.4)
|
actionview (4.2.6)
|
||||||
activesupport (= 4.2.4)
|
activesupport (= 4.2.6)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubis (~> 2.7.0)
|
erubis (~> 2.7.0)
|
||||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||||
activejob (4.2.4)
|
activejob (4.2.6)
|
||||||
activesupport (= 4.2.4)
|
activesupport (= 4.2.6)
|
||||||
globalid (>= 0.3.0)
|
globalid (>= 0.3.0)
|
||||||
activemodel (4.2.4)
|
activemodel (4.2.6)
|
||||||
activesupport (= 4.2.4)
|
activesupport (= 4.2.6)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
activerecord (4.2.4)
|
activerecord (4.2.6)
|
||||||
activemodel (= 4.2.4)
|
activemodel (= 4.2.6)
|
||||||
activesupport (= 4.2.4)
|
activesupport (= 4.2.6)
|
||||||
arel (~> 6.0)
|
arel (~> 6.0)
|
||||||
activesupport (4.2.4)
|
activesupport (4.2.6)
|
||||||
i18n (~> 0.7)
|
i18n (~> 0.7)
|
||||||
json (~> 1.7, >= 1.7.7)
|
json (~> 1.7, >= 1.7.7)
|
||||||
minitest (~> 5.1)
|
minitest (~> 5.1)
|
||||||
thread_safe (~> 0.3, >= 0.3.4)
|
thread_safe (~> 0.3, >= 0.3.4)
|
||||||
tzinfo (~> 1.1)
|
tzinfo (~> 1.1)
|
||||||
addressable (2.3.8)
|
addressable (2.4.0)
|
||||||
arel (6.0.3)
|
arel (6.0.3)
|
||||||
bcrypt (3.1.10)
|
bcrypt (3.1.11)
|
||||||
bourbon (4.2.5)
|
bourbon (4.2.7)
|
||||||
sass (~> 3.4)
|
sass (~> 3.4)
|
||||||
thor (~> 0.19)
|
thor (~> 0.19)
|
||||||
builder (3.2.2)
|
builder (3.2.2)
|
||||||
capybara (2.5.0)
|
capybara (2.7.1)
|
||||||
|
addressable
|
||||||
mime-types (>= 1.16)
|
mime-types (>= 1.16)
|
||||||
nokogiri (>= 1.3.3)
|
nokogiri (>= 1.3.3)
|
||||||
rack (>= 1.0.0)
|
rack (>= 1.0.0)
|
||||||
@@ -90,54 +91,55 @@ GEM
|
|||||||
climate_control (0.0.3)
|
climate_control (0.0.3)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
cliver (0.3.2)
|
cliver (0.3.2)
|
||||||
cocaine (0.5.7)
|
cocaine (0.5.8)
|
||||||
climate_control (>= 0.0.3, < 1.0)
|
climate_control (>= 0.0.3, < 1.0)
|
||||||
coderay (1.1.0)
|
coderay (1.1.1)
|
||||||
coffee-script (2.4.1)
|
coffee-script (2.4.1)
|
||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.9.1.1)
|
coffee-script-source (1.10.0)
|
||||||
couch_potato (1.4.0)
|
concurrent-ruby (1.0.2)
|
||||||
activemodel
|
couch_potato (1.7.0)
|
||||||
couchrest (~> 1.2.0)
|
activemodel (~> 4.0)
|
||||||
|
couchrest (~> 2.0.0.rc3)
|
||||||
json (~> 1.6)
|
json (~> 1.6)
|
||||||
couchrest (1.2.1)
|
couchrest (2.0.0.rc3)
|
||||||
|
httpclient (~> 2.7)
|
||||||
mime-types (>= 1.15)
|
mime-types (>= 1.15)
|
||||||
multi_json (~> 1.7, ~> 1.0)
|
multi_json (~> 1.7)
|
||||||
rest-client (~> 1.8.0)
|
|
||||||
daemons (1.2.3)
|
daemons (1.2.3)
|
||||||
devise (3.5.2)
|
devise (4.1.1)
|
||||||
bcrypt (~> 3.0)
|
bcrypt (~> 3.0)
|
||||||
orm_adapter (~> 0.1)
|
orm_adapter (~> 0.1)
|
||||||
railties (>= 3.2.6, < 5)
|
railties (>= 4.1.0, < 5.1)
|
||||||
responders
|
responders
|
||||||
thread_safe (~> 0.1)
|
|
||||||
warden (~> 1.2.3)
|
warden (~> 1.2.3)
|
||||||
diff-lcs (1.2.5)
|
diff-lcs (1.2.5)
|
||||||
domain_name (0.5.24)
|
domain_name (0.5.20160310)
|
||||||
unf (>= 0.0.5, < 1.0.0)
|
unf (>= 0.0.5, < 1.0.0)
|
||||||
email_validator (1.6.0)
|
email_validator (1.6.0)
|
||||||
activemodel
|
activemodel
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
eventmachine (1.0.8)
|
eventmachine (1.2.0.1)
|
||||||
execjs (2.6.0)
|
execjs (2.7.0)
|
||||||
factory_girl (4.5.0)
|
factory_girl (4.7.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
factory_girl_rails (4.5.0)
|
factory_girl_rails (4.7.0)
|
||||||
factory_girl (~> 4.5.0)
|
factory_girl (~> 4.7.0)
|
||||||
railties (>= 3.0.0)
|
railties (>= 3.0.0)
|
||||||
font-awesome-rails (4.4.0.0)
|
font-awesome-rails (4.6.3.0)
|
||||||
railties (>= 3.2, < 5.0)
|
railties (>= 3.2, < 5.1)
|
||||||
foundation-rails (5.5.2.1)
|
foundation-rails (5.5.3.2)
|
||||||
railties (>= 3.1.0)
|
railties (>= 3.1.0)
|
||||||
sass (>= 3.3.0, < 3.5)
|
sass (>= 3.3.0, < 3.5)
|
||||||
globalid (0.3.6)
|
globalid (0.3.6)
|
||||||
activesupport (>= 4.1.0)
|
activesupport (>= 4.1.0)
|
||||||
http-cookie (1.0.2)
|
http-cookie (1.0.2)
|
||||||
domain_name (~> 0.5)
|
domain_name (~> 0.5)
|
||||||
|
httpclient (2.8.0)
|
||||||
i18n (0.7.0)
|
i18n (0.7.0)
|
||||||
jquery-rails (4.0.5)
|
jquery-rails (4.1.1)
|
||||||
rails-dom-testing (~> 1.0)
|
rails-dom-testing (>= 1, < 3)
|
||||||
railties (>= 4.2.0)
|
railties (>= 4.2.0)
|
||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
json (1.8.3)
|
json (1.8.3)
|
||||||
@@ -145,18 +147,18 @@ GEM
|
|||||||
addressable (~> 2.3)
|
addressable (~> 2.3)
|
||||||
loofah (2.0.3)
|
loofah (2.0.3)
|
||||||
nokogiri (>= 1.5.9)
|
nokogiri (>= 1.5.9)
|
||||||
mail (2.6.3)
|
mail (2.6.4)
|
||||||
mime-types (>= 1.16, < 3)
|
mime-types (>= 1.16, < 4)
|
||||||
method_source (0.8.2)
|
method_source (0.8.2)
|
||||||
mime-types (2.6.2)
|
mime-types (2.99.2)
|
||||||
mimemagic (0.3.0)
|
mimemagic (0.3.0)
|
||||||
mini_portile (0.6.2)
|
mini_portile2 (2.0.0)
|
||||||
minitest (5.8.1)
|
minitest (5.9.0)
|
||||||
multi_json (1.11.2)
|
multi_json (1.12.1)
|
||||||
netrc (0.10.3)
|
netrc (0.11.0)
|
||||||
nokogiri (1.6.6.2)
|
nokogiri (1.6.7.2)
|
||||||
mini_portile (~> 0.6.0)
|
mini_portile2 (~> 2.0.0.rc2)
|
||||||
paperclip (4.3.1)
|
paperclip (4.3.6)
|
||||||
activemodel (>= 3.2.0)
|
activemodel (>= 3.2.0)
|
||||||
activesupport (>= 3.2.0)
|
activesupport (>= 3.2.0)
|
||||||
cocaine (~> 0.5.5)
|
cocaine (~> 0.5.5)
|
||||||
@@ -164,12 +166,12 @@ GEM
|
|||||||
mimemagic (= 0.3.0)
|
mimemagic (= 0.3.0)
|
||||||
pickadate-rails (3.5.6.0)
|
pickadate-rails (3.5.6.0)
|
||||||
railties (>= 3.1.0)
|
railties (>= 3.1.0)
|
||||||
poltergeist (1.7.0)
|
poltergeist (1.9.0)
|
||||||
capybara (~> 2.1)
|
capybara (~> 2.1)
|
||||||
cliver (~> 0.3.1)
|
cliver (~> 0.3.1)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
websocket-driver (>= 0.2.0)
|
websocket-driver (>= 0.2.0)
|
||||||
pry (0.10.2)
|
pry (0.10.3)
|
||||||
coderay (~> 1.1.0)
|
coderay (~> 1.1.0)
|
||||||
method_source (~> 0.8.1)
|
method_source (~> 0.8.1)
|
||||||
slop (~> 3.4)
|
slop (~> 3.4)
|
||||||
@@ -178,16 +180,16 @@ GEM
|
|||||||
rack (1.6.4)
|
rack (1.6.4)
|
||||||
rack-test (0.6.3)
|
rack-test (0.6.3)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
rails (4.2.4)
|
rails (4.2.6)
|
||||||
actionmailer (= 4.2.4)
|
actionmailer (= 4.2.6)
|
||||||
actionpack (= 4.2.4)
|
actionpack (= 4.2.6)
|
||||||
actionview (= 4.2.4)
|
actionview (= 4.2.6)
|
||||||
activejob (= 4.2.4)
|
activejob (= 4.2.6)
|
||||||
activemodel (= 4.2.4)
|
activemodel (= 4.2.6)
|
||||||
activerecord (= 4.2.4)
|
activerecord (= 4.2.6)
|
||||||
activesupport (= 4.2.4)
|
activesupport (= 4.2.6)
|
||||||
bundler (>= 1.3.0, < 2.0)
|
bundler (>= 1.3.0, < 2.0)
|
||||||
railties (= 4.2.4)
|
railties (= 4.2.6)
|
||||||
sprockets-rails
|
sprockets-rails
|
||||||
rails-deprecated_sanitizer (1.0.3)
|
rails-deprecated_sanitizer (1.0.3)
|
||||||
activesupport (>= 4.2.0.alpha)
|
activesupport (>= 4.2.0.alpha)
|
||||||
@@ -195,49 +197,49 @@ GEM
|
|||||||
activesupport (>= 4.2.0.beta, < 5.0)
|
activesupport (>= 4.2.0.beta, < 5.0)
|
||||||
nokogiri (~> 1.6.0)
|
nokogiri (~> 1.6.0)
|
||||||
rails-deprecated_sanitizer (>= 1.0.1)
|
rails-deprecated_sanitizer (>= 1.0.1)
|
||||||
rails-html-sanitizer (1.0.2)
|
rails-html-sanitizer (1.0.3)
|
||||||
loofah (~> 2.0)
|
loofah (~> 2.0)
|
||||||
railties (4.2.4)
|
railties (4.2.6)
|
||||||
actionpack (= 4.2.4)
|
actionpack (= 4.2.6)
|
||||||
activesupport (= 4.2.4)
|
activesupport (= 4.2.6)
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
thor (>= 0.18.1, < 2.0)
|
thor (>= 0.18.1, < 2.0)
|
||||||
rake (10.4.2)
|
rake (11.1.2)
|
||||||
responders (2.1.0)
|
responders (2.2.0)
|
||||||
railties (>= 4.2.0, < 5)
|
railties (>= 4.2.0, < 5.1)
|
||||||
rest-client (1.8.0)
|
rest-client (1.8.0)
|
||||||
http-cookie (>= 1.0.2, < 2.0)
|
http-cookie (>= 1.0.2, < 2.0)
|
||||||
mime-types (>= 1.16, < 3.0)
|
mime-types (>= 1.16, < 3.0)
|
||||||
netrc (~> 0.7)
|
netrc (~> 0.7)
|
||||||
rspec-core (3.3.2)
|
rspec-core (3.4.4)
|
||||||
rspec-support (~> 3.3.0)
|
rspec-support (~> 3.4.0)
|
||||||
rspec-expectations (3.3.1)
|
rspec-expectations (3.4.0)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.3.0)
|
rspec-support (~> 3.4.0)
|
||||||
rspec-its (1.2.0)
|
rspec-its (1.2.0)
|
||||||
rspec-core (>= 3.0.0)
|
rspec-core (>= 3.0.0)
|
||||||
rspec-expectations (>= 3.0.0)
|
rspec-expectations (>= 3.0.0)
|
||||||
rspec-mocks (3.3.2)
|
rspec-mocks (3.4.1)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.3.0)
|
rspec-support (~> 3.4.0)
|
||||||
rspec-rails (3.3.3)
|
rspec-rails (3.4.2)
|
||||||
actionpack (>= 3.0, < 4.3)
|
actionpack (>= 3.0, < 4.3)
|
||||||
activesupport (>= 3.0, < 4.3)
|
activesupport (>= 3.0, < 4.3)
|
||||||
railties (>= 3.0, < 4.3)
|
railties (>= 3.0, < 4.3)
|
||||||
rspec-core (~> 3.3.0)
|
rspec-core (~> 3.4.0)
|
||||||
rspec-expectations (~> 3.3.0)
|
rspec-expectations (~> 3.4.0)
|
||||||
rspec-mocks (~> 3.3.0)
|
rspec-mocks (~> 3.4.0)
|
||||||
rspec-support (~> 3.3.0)
|
rspec-support (~> 3.4.0)
|
||||||
rspec-support (3.3.0)
|
rspec-support (3.4.1)
|
||||||
sass (3.4.18)
|
sass (3.4.22)
|
||||||
sass-rails (5.0.4)
|
sass-rails (5.0.4)
|
||||||
railties (>= 4.0.0, < 5.0)
|
railties (>= 4.0.0, < 5.0)
|
||||||
sass (~> 3.1)
|
sass (~> 3.1)
|
||||||
sprockets (>= 2.8, < 4.0)
|
sprockets (>= 2.8, < 4.0)
|
||||||
sprockets-rails (>= 2.0, < 4.0)
|
sprockets-rails (>= 2.0, < 4.0)
|
||||||
tilt (>= 1.1, < 3)
|
tilt (>= 1.1, < 3)
|
||||||
slim (3.0.6)
|
slim (3.0.7)
|
||||||
temple (~> 0.7.3)
|
temple (~> 0.7.6)
|
||||||
tilt (>= 1.3.3, < 2.1)
|
tilt (>= 1.3.3, < 2.1)
|
||||||
slim-rails (3.0.1)
|
slim-rails (3.0.1)
|
||||||
actionmailer (>= 3.1, < 5.0)
|
actionmailer (>= 3.1, < 5.0)
|
||||||
@@ -246,30 +248,31 @@ GEM
|
|||||||
railties (>= 3.1, < 5.0)
|
railties (>= 3.1, < 5.0)
|
||||||
slim (~> 3.0)
|
slim (~> 3.0)
|
||||||
slop (3.6.0)
|
slop (3.6.0)
|
||||||
sprockets (3.3.5)
|
sprockets (3.6.0)
|
||||||
|
concurrent-ruby (~> 1.0)
|
||||||
rack (> 1, < 3)
|
rack (> 1, < 3)
|
||||||
sprockets-rails (2.3.3)
|
sprockets-rails (3.0.4)
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 4.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 4.0)
|
||||||
sprockets (>= 2.8, < 4.0)
|
sprockets (>= 3.0.0)
|
||||||
temple (0.7.6)
|
temple (0.7.7)
|
||||||
thin (1.6.4)
|
thin (1.7.0)
|
||||||
daemons (~> 1.0, >= 1.0.9)
|
daemons (~> 1.0, >= 1.0.9)
|
||||||
eventmachine (~> 1.0, >= 1.0.4)
|
eventmachine (~> 1.0, >= 1.0.4)
|
||||||
rack (~> 1.0)
|
rack (>= 1, < 3)
|
||||||
thor (0.19.1)
|
thor (0.19.1)
|
||||||
thread_safe (0.3.5)
|
thread_safe (0.3.5)
|
||||||
tilt (2.0.1)
|
tilt (2.0.4)
|
||||||
tinymce-rails (4.2.5)
|
tinymce-rails (4.3.12)
|
||||||
railties (>= 3.1.1)
|
railties (>= 3.1.1)
|
||||||
tzinfo (1.2.2)
|
tzinfo (1.2.2)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
unf (0.1.4)
|
unf (0.1.4)
|
||||||
unf_ext
|
unf_ext
|
||||||
unf_ext (0.0.7.1)
|
unf_ext (0.0.7.2)
|
||||||
warden (1.2.3)
|
warden (1.2.6)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
websocket-driver (0.6.2)
|
websocket-driver (0.6.4)
|
||||||
websocket-extensions (>= 0.1.0)
|
websocket-extensions (>= 0.1.0)
|
||||||
websocket-extensions (0.1.2)
|
websocket-extensions (0.1.2)
|
||||||
xpath (2.0.0)
|
xpath (2.0.0)
|
||||||
@@ -289,7 +292,7 @@ DEPENDENCIES
|
|||||||
email_validator
|
email_validator
|
||||||
factory_girl_rails
|
factory_girl_rails
|
||||||
font-awesome-rails
|
font-awesome-rails
|
||||||
foundation-rails
|
foundation-rails (~> 5.5)
|
||||||
jquery-rails
|
jquery-rails
|
||||||
launchy
|
launchy
|
||||||
orm_adapter!
|
orm_adapter!
|
||||||
@@ -305,3 +308,6 @@ DEPENDENCIES
|
|||||||
slim-rails
|
slim-rails
|
||||||
thin
|
thin
|
||||||
tinymce-rails
|
tinymce-rails
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
1.12.3
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
=raw @page.body
|
== @page.body
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ module Cmtool
|
|||||||
page_name = "home"
|
page_name = "home"
|
||||||
@page = find_page(page_name)
|
@page = find_page(page_name)
|
||||||
@sub_pages = @page.children.select{|child| child.in_menu.present? }
|
@sub_pages = @page.children.select{|child| child.in_menu.present? }
|
||||||
render :template => "pages/#{page_name}", :layout => @page.layout.presence || ::Page.layouts.first.to_s
|
render template: "pages/#{page_name}", layout: @page.layout.presence || ::Page.layouts.first.to_s, formats: [:html]
|
||||||
end
|
end
|
||||||
|
|
||||||
# General catcher for pages
|
# General catcher for pages
|
||||||
@@ -17,10 +17,10 @@ module Cmtool
|
|||||||
@sub_pages = [@page] + @page.children.select{|child| child.in_menu.present? }
|
@sub_pages = [@page] + @page.children.select{|child| child.in_menu.present? }
|
||||||
template = "pages/#{@page.name}"
|
template = "pages/#{@page.name}"
|
||||||
if template_exists?(template)
|
if template_exists?(template)
|
||||||
render :template => template, :layout => @page.layout.presence || ::Page.layouts.first
|
render template: template, formats: [:html], layout: @page.layout.presence || ::Page.layouts.first
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
render :layout => @page.layout.presence || ::Page.layouts.first
|
render formats: [:html], layout: @page.layout.presence || ::Page.layouts.first
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ module Cmtool
|
|||||||
private
|
private
|
||||||
|
|
||||||
def find_page(name)
|
def find_page(name)
|
||||||
::Page.find_by_name_and_locale(name, I18n.locale.to_s) || ::Page.new(:name => name, locale: I18n.locale.to_s)
|
::Page.find_by_name_and_locale(name, I18n.locale.to_s) || ::Page.new(name: name, locale: I18n.locale.to_s)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ describe Cmtool::NewsletterSubscriptionsController, type: :controller do
|
|||||||
describe "GET show" do
|
describe "GET show" do
|
||||||
it "assigns the requested newsletter_subscription as @newsletter_subscription" do
|
it "assigns the requested newsletter_subscription as @newsletter_subscription" do
|
||||||
newsletter_subscription = create :newsletter_subscription
|
newsletter_subscription = create :newsletter_subscription
|
||||||
get :show, :id => newsletter_subscription.id
|
get :show, id: newsletter_subscription.id
|
||||||
assigns(:newsletter_subscription).should eq(newsletter_subscription)
|
assigns(:newsletter_subscription).should eq(newsletter_subscription)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -50,7 +50,7 @@ describe Cmtool::NewsletterSubscriptionsController, type: :controller do
|
|||||||
describe "GET edit" do
|
describe "GET edit" do
|
||||||
it "assigns the requested newsletter_subscription as @newsletter_subscription" do
|
it "assigns the requested newsletter_subscription as @newsletter_subscription" do
|
||||||
newsletter_subscription = create :newsletter_subscription
|
newsletter_subscription = create :newsletter_subscription
|
||||||
get :edit, :id => newsletter_subscription.id
|
get :edit, id: newsletter_subscription.id
|
||||||
assigns(:newsletter_subscription).should eq(newsletter_subscription)
|
assigns(:newsletter_subscription).should eq(newsletter_subscription)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -59,18 +59,18 @@ describe Cmtool::NewsletterSubscriptionsController, type: :controller do
|
|||||||
describe "with valid params" do
|
describe "with valid params" do
|
||||||
it "creates a new Cmtool::NewsletterSubscription" do
|
it "creates a new Cmtool::NewsletterSubscription" do
|
||||||
expect {
|
expect {
|
||||||
post :create, :newsletter_subscription => build(:newsletter_subscription).attributes
|
post :create, newsletter_subscription: build(:newsletter_subscription).attributes
|
||||||
}.to change(Cmtool::NewsletterSubscription, :count).by(1)
|
}.to change(Cmtool::NewsletterSubscription, :count).by(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "assigns a newly created newsletter_subscription as @newsletter_subscription" do
|
it "assigns a newly created newsletter_subscription as @newsletter_subscription" do
|
||||||
post :create, :newsletter_subscription => build(:newsletter_subscription).attributes
|
post :create, newsletter_subscription: build(:newsletter_subscription).attributes
|
||||||
assigns(:newsletter_subscription).should be_a(Cmtool::NewsletterSubscription)
|
assigns(:newsletter_subscription).should be_a(Cmtool::NewsletterSubscription)
|
||||||
assigns(:newsletter_subscription).should be_persisted
|
assigns(:newsletter_subscription).should be_persisted
|
||||||
end
|
end
|
||||||
|
|
||||||
it "redirects to the newsletter_subscriptions newsletter_subscription" do
|
it "redirects to the newsletter_subscriptions newsletter_subscription" do
|
||||||
post :create, :newsletter_subscription => build(:newsletter_subscription).attributes
|
post :create, newsletter_subscription: build(:newsletter_subscription).attributes
|
||||||
response.should redirect_to(Cmtool::NewsletterSubscription.last)
|
response.should redirect_to(Cmtool::NewsletterSubscription.last)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -79,14 +79,14 @@ describe Cmtool::NewsletterSubscriptionsController, type: :controller do
|
|||||||
it "assigns a newly created but unsaved newsletter_subscription as @newsletter_subscription" do
|
it "assigns a newly created but unsaved newsletter_subscription as @newsletter_subscription" do
|
||||||
# Trigger the behavior that occurs when invalid params are submitted
|
# Trigger the behavior that occurs when invalid params are submitted
|
||||||
allow_any_instance_of( Cmtool::NewsletterSubscription ).to receive(:save).and_return(false)
|
allow_any_instance_of( Cmtool::NewsletterSubscription ).to receive(:save).and_return(false)
|
||||||
post :create, :newsletter_subscription => {email: ''}
|
post :create, newsletter_subscription: {email: ''}
|
||||||
assigns(:newsletter_subscription).should be_a_new(Cmtool::NewsletterSubscription)
|
assigns(:newsletter_subscription).should be_a_new(Cmtool::NewsletterSubscription)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "re-renders the 'new' template" do
|
it "re-renders the 'new' template" do
|
||||||
# Trigger the behavior that occurs when invalid params are submitted
|
# Trigger the behavior that occurs when invalid params are submitted
|
||||||
allow_any_instance_of( Cmtool::NewsletterSubscription ).to receive(:save).and_return(false)
|
allow_any_instance_of( Cmtool::NewsletterSubscription ).to receive(:save).and_return(false)
|
||||||
post :create, :newsletter_subscription => {email: ''}
|
post :create, newsletter_subscription: {email: ''}
|
||||||
response.should render_template("new")
|
response.should render_template("new")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -100,19 +100,19 @@ describe Cmtool::NewsletterSubscriptionsController, type: :controller do
|
|||||||
# specifies that the Cmtool::NewsletterSubscription created on the previous line
|
# specifies that the Cmtool::NewsletterSubscription created on the previous line
|
||||||
# receives the :update_attributes message with whatever params are
|
# receives the :update_attributes message with whatever params are
|
||||||
# submitted in the request.
|
# submitted in the request.
|
||||||
Cmtool::NewsletterSubscription.any_instance.should_receive(:update_attributes).with({'email' => 'test44@cmtool.nl'})
|
Cmtool::NewsletterSubscription.any_instance.should_receive(:update_attributes).with('email' => 'test44@cmtool.nl')
|
||||||
put :update, :id => newsletter_subscription.id, :newsletter_subscription => {'email' => 'test44@cmtool.nl'}
|
put :update, id: newsletter_subscription.id, newsletter_subscription: {'email' => 'test44@cmtool.nl'}
|
||||||
end
|
end
|
||||||
|
|
||||||
it "assigns the requested newsletter_subscription as @newsletter_subscription" do
|
it "assigns the requested newsletter_subscription as @newsletter_subscription" do
|
||||||
newsletter_subscription = create(:newsletter_subscription)
|
newsletter_subscription = create(:newsletter_subscription)
|
||||||
put :update, :id => newsletter_subscription.id, :newsletter_subscription => newsletter_subscription.attributes
|
put :update, id: newsletter_subscription.id, newsletter_subscription: newsletter_subscription.attributes
|
||||||
assigns(:newsletter_subscription).should eq(newsletter_subscription)
|
assigns(:newsletter_subscription).id.should eq newsletter_subscription.id
|
||||||
end
|
end
|
||||||
|
|
||||||
it "redirects to the newsletter_subscription" do
|
it "redirects to the newsletter_subscription" do
|
||||||
newsletter_subscription = create(:newsletter_subscription)
|
newsletter_subscription = create(:newsletter_subscription)
|
||||||
put :update, :id => newsletter_subscription.id, :newsletter_subscription => newsletter_subscription.attributes
|
put :update, id: newsletter_subscription.id, newsletter_subscription: newsletter_subscription.attributes
|
||||||
response.should redirect_to(newsletter_subscription)
|
response.should redirect_to(newsletter_subscription)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -122,7 +122,7 @@ describe Cmtool::NewsletterSubscriptionsController, type: :controller do
|
|||||||
newsletter_subscription = create(:newsletter_subscription)
|
newsletter_subscription = create(:newsletter_subscription)
|
||||||
# Trigger the behavior that occurs when invalid params are submitted
|
# Trigger the behavior that occurs when invalid params are submitted
|
||||||
Cmtool::NewsletterSubscription.any_instance.stub(:save).and_return(false)
|
Cmtool::NewsletterSubscription.any_instance.stub(:save).and_return(false)
|
||||||
put :update, :id => newsletter_subscription.id, :newsletter_subscription => {email: ''}
|
put :update, id: newsletter_subscription.id, newsletter_subscription: {email: ''}
|
||||||
assigns(:newsletter_subscription).should eq(newsletter_subscription)
|
assigns(:newsletter_subscription).should eq(newsletter_subscription)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ describe Cmtool::NewsletterSubscriptionsController, type: :controller do
|
|||||||
newsletter_subscription = create(:newsletter_subscription)
|
newsletter_subscription = create(:newsletter_subscription)
|
||||||
# Trigger the behavior that occurs when invalid params are submitted
|
# Trigger the behavior that occurs when invalid params are submitted
|
||||||
Cmtool::NewsletterSubscription.any_instance.stub(:save).and_return(false)
|
Cmtool::NewsletterSubscription.any_instance.stub(:save).and_return(false)
|
||||||
put :update, :id => newsletter_subscription.id, :newsletter_subscription => {email: ''}
|
put :update, id: newsletter_subscription.id, newsletter_subscription: {email: ''}
|
||||||
response.should render_template("edit")
|
response.should render_template("edit")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -141,20 +141,20 @@ describe Cmtool::NewsletterSubscriptionsController, type: :controller do
|
|||||||
@request.env['HTTP_REFERER'] = newsletter_subscriptions_path
|
@request.env['HTTP_REFERER'] = newsletter_subscriptions_path
|
||||||
newsletter_subscription = create(:newsletter_subscription)
|
newsletter_subscription = create(:newsletter_subscription)
|
||||||
expect {
|
expect {
|
||||||
delete :destroy, :id => newsletter_subscription.id
|
delete :destroy, id: newsletter_subscription.id
|
||||||
}.to change(Cmtool::NewsletterSubscription, :count).by(-1)
|
}.to change(Cmtool::NewsletterSubscription, :count).by(-1)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "redirects to the newsletter_subscriptions list" do
|
it "redirects to the newsletter_subscriptions list" do
|
||||||
@request.env['HTTP_REFERER'] = newsletter_subscriptions_path
|
@request.env['HTTP_REFERER'] = newsletter_subscriptions_path
|
||||||
newsletter_subscription = create(:newsletter_subscription)
|
newsletter_subscription = create(:newsletter_subscription)
|
||||||
delete :destroy, :id => newsletter_subscription.id
|
delete :destroy, id: newsletter_subscription.id
|
||||||
response.should redirect_to(newsletter_subscriptions_path)
|
response.should redirect_to(newsletter_subscriptions_path)
|
||||||
end
|
end
|
||||||
it "redirects to the newsletter_subscriptions list when called from edit page" do
|
it "redirects to the newsletter_subscriptions list when called from edit page" do
|
||||||
newsletter_subscription = create(:newsletter_subscription)
|
newsletter_subscription = create(:newsletter_subscription)
|
||||||
@request.env['HTTP_REFERER'] = edit_newsletter_subscription_path(newsletter_subscription)
|
@request.env['HTTP_REFERER'] = edit_newsletter_subscription_path(newsletter_subscription)
|
||||||
delete :destroy, :id => newsletter_subscription.id
|
delete :destroy, id: newsletter_subscription.id
|
||||||
response.should redirect_to(newsletter_subscriptions_path)
|
response.should redirect_to(newsletter_subscriptions_path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user