fix failing tests, ugly solution that should be handled by rspec in the future

This commit is contained in:
2012-06-25 11:02:47 +02:00
parent 0a10dada4d
commit e71ab89984
10 changed files with 129 additions and 83 deletions
+1
View File
@@ -8,3 +8,4 @@ spec/dummy/tmp/
spec/dummy/.sass-cache spec/dummy/.sass-cache
spec/dummy/public spec/dummy/public
*.gem *.gem
routes.txt
+5 -2
View File
@@ -10,7 +10,7 @@ gem "jquery-rails"
gem 'couch_potato' , :git => 'git://github.com/bterkuile/couch_potato.git' gem 'couch_potato' , :git => 'git://github.com/bterkuile/couch_potato.git'
gem 'simply_stored' , :git => 'git://github.com/bterkuile/simply_stored.git' gem 'simply_stored' , :git => 'git://github.com/bterkuile/simply_stored.git'
gem 'devise' gem 'devise', '2.0.4'
gem 'devise_simply_stored' gem 'devise_simply_stored'
gem 'tinymce-rails' gem 'tinymce-rails'
gem 'haml-rails' gem 'haml-rails'
@@ -31,7 +31,10 @@ group :test do
gem 'rspec-rails' gem 'rspec-rails'
gem 'factory_girl_rails' gem 'factory_girl_rails'
gem 'capybara' gem 'capybara'
gem 'pry'
end end
group :development do group :development do
gem 'ruby-debug19', :require => 'ruby-debug' gem 'pry'
gem 'thin'
#gem 'ruby-debug19', :require => 'ruby-debug'
end end
+80 -77
View File
@@ -1,17 +1,17 @@
GIT GIT
remote: git://github.com/bterkuile/couch_potato.git remote: git://github.com/bterkuile/couch_potato.git
revision: 2f0252bc1b93675ccc4f0ff6a193c2acff59bc2e revision: ff7505c432cabfccb55cfa732a548d9449d8250c
specs: specs:
couch_potato (0.6.0) couch_potato (0.7.0.pre.1)
activemodel activemodel
couchrest (>= 1.0.1) couchrest (>= 1.0.1)
json (~> 1.6.0) json (~> 1.6.0)
GIT GIT
remote: git://github.com/bterkuile/simply_stored.git remote: git://github.com/bterkuile/simply_stored.git
revision: abe990e1d97763ef90d3ff010d449bf2adf5a227 revision: 0359fa86f4025e0a84953c68c7e6e351e9601cbf
specs: specs:
simply_stored (0.5.4) simply_stored (1.0.0)
activesupport activesupport
couch_potato (>= 0.2.15) couch_potato (>= 0.2.15)
rest-client (>= 1.4.2) rest-client (>= 1.4.2)
@@ -35,37 +35,37 @@ PATH
GEM GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
specs: specs:
actionmailer (3.2.3) actionmailer (3.2.6)
actionpack (= 3.2.3) actionpack (= 3.2.6)
mail (~> 2.4.4) mail (~> 2.4.4)
actionpack (3.2.3) actionpack (3.2.6)
activemodel (= 3.2.3) activemodel (= 3.2.6)
activesupport (= 3.2.3) activesupport (= 3.2.6)
builder (~> 3.0.0) builder (~> 3.0.0)
erubis (~> 2.7.0) erubis (~> 2.7.0)
journey (~> 1.0.1) journey (~> 1.0.1)
rack (~> 1.4.0) rack (~> 1.4.0)
rack-cache (~> 1.2) rack-cache (~> 1.2)
rack-test (~> 0.6.1) rack-test (~> 0.6.1)
sprockets (~> 2.1.2) sprockets (~> 2.1.3)
activemodel (3.2.3) activemodel (3.2.6)
activesupport (= 3.2.3) activesupport (= 3.2.6)
builder (~> 3.0.0) builder (~> 3.0.0)
activerecord (3.2.3) activerecord (3.2.6)
activemodel (= 3.2.3) activemodel (= 3.2.6)
activesupport (= 3.2.3) activesupport (= 3.2.6)
arel (~> 3.0.2) arel (~> 3.0.2)
tzinfo (~> 0.3.29) tzinfo (~> 0.3.29)
activeresource (3.2.3) activeresource (3.2.6)
activemodel (= 3.2.3) activemodel (= 3.2.6)
activesupport (= 3.2.3) activesupport (= 3.2.6)
activesupport (3.2.3) activesupport (3.2.6)
i18n (~> 0.6) i18n (~> 0.6)
multi_json (~> 1.0) multi_json (~> 1.0)
archive-tar-minitar (0.5.2) addressable (2.2.8)
arel (3.0.2) arel (3.0.2)
bcrypt-ruby (3.0.1) bcrypt-ruby (3.0.1)
bourbon (1.4.0) bourbon (2.1.0)
sass (>= 3.1) sass (>= 3.1)
builder (3.0.0) builder (3.0.0)
capybara (1.1.2) capybara (1.1.2)
@@ -75,18 +75,19 @@ GEM
rack-test (>= 0.5.4) rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0) selenium-webdriver (~> 2.0)
xpath (~> 0.1.4) xpath (~> 0.1.4)
childprocess (0.3.1) childprocess (0.3.2)
ffi (~> 1.0.6) ffi (~> 1.0.6)
cocaine (0.2.1) cocaine (0.2.1)
coderay (1.0.7)
coffee-script (2.2.0) coffee-script (2.2.0)
coffee-script-source coffee-script-source
execjs execjs
coffee-script-source (1.2.0) coffee-script-source (1.3.3)
columnize (0.3.6)
couchrest (1.1.2) couchrest (1.1.2)
mime-types (~> 1.15) mime-types (~> 1.15)
multi_json (~> 1.0.0) multi_json (~> 1.0.0)
rest-client (~> 1.6.1) rest-client (~> 1.6.1)
daemons (1.1.8)
devise (2.0.4) devise (2.0.4)
bcrypt-ruby (~> 3.0) bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3) orm_adapter (~> 0.0.3)
@@ -98,15 +99,16 @@ GEM
email_validator (1.3.0) email_validator (1.3.0)
activemodel activemodel
erubis (2.7.0) erubis (2.7.0)
execjs (1.3.0) eventmachine (0.12.10)
execjs (1.4.0)
multi_json (~> 1.0) multi_json (~> 1.0)
factory_girl (3.0.0) factory_girl (3.5.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
factory_girl_rails (3.0.0) factory_girl_rails (3.5.0)
factory_girl (~> 3.0.0) factory_girl (~> 3.5.0)
railties (>= 3.0.0) railties (>= 3.0.0)
ffi (1.0.11) ffi (1.0.11)
haml (3.1.4) haml (3.1.6)
haml-rails (0.3.4) haml-rails (0.3.4)
actionpack (~> 3.0) actionpack (~> 3.0)
activesupport (~> 3.0) activesupport (~> 3.0)
@@ -114,28 +116,33 @@ GEM
railties (~> 3.0) railties (~> 3.0)
hike (1.2.1) hike (1.2.1)
i18n (0.6.0) i18n (0.6.0)
journey (1.0.3) journey (1.0.4)
jquery-rails (2.0.1) jquery-rails (2.0.2)
railties (>= 3.2.0, < 5.0) railties (>= 3.2.0, < 5.0)
thor (~> 0.14) thor (~> 0.14)
json (1.6.6) json (1.6.7)
linecache19 (0.5.12) libwebsocket (0.1.3)
ruby_core_source (>= 0.1.4) addressable
mail (2.4.4) mail (2.4.4)
i18n (>= 0.4.0) i18n (>= 0.4.0)
mime-types (~> 1.16) mime-types (~> 1.16)
treetop (~> 1.4.8) treetop (~> 1.4.8)
mime-types (1.18) method_source (0.7.1)
mime-types (1.19)
multi_json (1.0.4) multi_json (1.0.4)
nokogiri (1.5.2) nokogiri (1.5.5)
orm_adapter (0.0.7) orm_adapter (0.0.7)
paperclip (3.0.1) paperclip (3.1.2)
activemodel (>= 3.0.0) activemodel (>= 3.0.0)
activerecord (>= 3.0.0) activerecord (>= 3.0.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
cocaine (>= 0.0.2) cocaine (>= 0.0.2)
mime-types mime-types
polyglot (0.3.3) polyglot (0.3.3)
pry (0.9.9.6)
coderay (~> 1.0.5)
method_source (~> 0.7.1)
slop (>= 2.4.4, < 3)
rack (1.4.1) rack (1.4.1)
rack-cache (1.2) rack-cache (1.2)
rack (>= 0.4) rack (>= 0.4)
@@ -143,72 +150,67 @@ GEM
rack rack
rack-test (0.6.1) rack-test (0.6.1)
rack (>= 1.0) rack (>= 1.0)
rails (3.2.3) rails (3.2.6)
actionmailer (= 3.2.3) actionmailer (= 3.2.6)
actionpack (= 3.2.3) actionpack (= 3.2.6)
activerecord (= 3.2.3) activerecord (= 3.2.6)
activeresource (= 3.2.3) activeresource (= 3.2.6)
activesupport (= 3.2.3) activesupport (= 3.2.6)
bundler (~> 1.0) bundler (~> 1.0)
railties (= 3.2.3) railties (= 3.2.6)
railties (3.2.3) railties (3.2.6)
actionpack (= 3.2.3) actionpack (= 3.2.6)
activesupport (= 3.2.3) activesupport (= 3.2.6)
rack-ssl (~> 1.3.2) rack-ssl (~> 1.3.2)
rake (>= 0.8.7) rake (>= 0.8.7)
rdoc (~> 3.4) rdoc (~> 3.4)
thor (~> 0.14.6) thor (>= 0.14.6, < 2.0)
rake (0.9.2.2) rake (0.9.2.2)
rdoc (3.12) rdoc (3.12)
json (~> 1.4) json (~> 1.4)
rest-client (1.6.7) rest-client (1.6.7)
mime-types (>= 1.16) mime-types (>= 1.16)
rspec (2.9.0) rspec (2.10.0)
rspec-core (~> 2.9.0) rspec-core (~> 2.10.0)
rspec-expectations (~> 2.9.0) rspec-expectations (~> 2.10.0)
rspec-mocks (~> 2.9.0) rspec-mocks (~> 2.10.0)
rspec-core (2.9.0) rspec-core (2.10.1)
rspec-expectations (2.9.0) rspec-expectations (2.10.0)
diff-lcs (~> 1.1.3) diff-lcs (~> 1.1.3)
rspec-mocks (2.9.0) rspec-mocks (2.10.1)
rspec-rails (2.9.0) rspec-rails (2.10.1)
actionpack (>= 3.0) actionpack (>= 3.0)
activesupport (>= 3.0) activesupport (>= 3.0)
railties (>= 3.0) railties (>= 3.0)
rspec (~> 2.9.0) rspec (~> 2.10.0)
ruby-debug-base19 (0.11.25) rubyzip (0.9.9)
columnize (>= 0.3.1) sass (3.1.19)
linecache19 (>= 0.5.11)
ruby_core_source (>= 0.1.4)
ruby-debug19 (0.11.6)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
ruby-debug-base19 (>= 0.11.19)
ruby_core_source (0.1.5)
archive-tar-minitar (>= 0.5.2)
rubyzip (0.9.6.1)
sass (3.1.15)
sass-rails (3.2.5) sass-rails (3.2.5)
railties (~> 3.2.0) railties (~> 3.2.0)
sass (>= 3.1.10) sass (>= 3.1.10)
tilt (~> 1.3) tilt (~> 1.3)
selenium-webdriver (2.20.0) selenium-webdriver (2.24.0)
childprocess (>= 0.2.5) childprocess (>= 0.2.5)
ffi (~> 1.0) libwebsocket (~> 0.1.3)
multi_json (~> 1.0) multi_json (~> 1.0)
rubyzip rubyzip
sprockets (2.1.2) slop (2.4.4)
sprockets (2.1.3)
hike (~> 1.2) hike (~> 1.2)
rack (~> 1.0) rack (~> 1.0)
tilt (~> 1.1, != 1.3.0) tilt (~> 1.1, != 1.3.0)
thor (0.14.6) thin (1.3.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.15.3)
tilt (1.3.3) tilt (1.3.3)
tinymce-rails (3.4.9) tinymce-rails (3.5.2)
railties (>= 3.1.1) railties (>= 3.1.1)
treetop (1.4.10) treetop (1.4.10)
polyglot polyglot
polyglot (>= 0.3.1) polyglot (>= 0.3.1)
tzinfo (0.3.32) tzinfo (0.3.33)
warden (1.1.1) warden (1.1.1)
rack (>= 1.0) rack (>= 1.0)
xpath (0.1.4) xpath (0.1.4)
@@ -223,15 +225,16 @@ DEPENDENCIES
cmtool! cmtool!
coffee-script coffee-script
couch_potato! couch_potato!
devise devise (= 2.0.4)
devise_simply_stored devise_simply_stored
email_validator email_validator
factory_girl_rails factory_girl_rails
haml-rails haml-rails
jquery-rails jquery-rails
paperclip paperclip
pry
rspec-rails rspec-rails
ruby-debug19
sass-rails sass-rails
simply_stored! simply_stored!
thin
tinymce-rails tinymce-rails
+1 -1
View File
@@ -29,7 +29,7 @@ module Cmtool
alias are_you_sure? are_you_sure alias are_you_sure? are_you_sure
def warnings def warnings
@cmtool_warnings @cmtool_warnings || []
end end
def boolean_text(yes) def boolean_text(yes)
+6 -2
View File
@@ -27,10 +27,14 @@ Cmtool::Engine.routes.draw do
# ADMIN FORMS # ADMIN FORMS
resources :contact_forms do resources :contact_forms do
post :add collection do
post :add
end
end end
resources :newsletter_subscriptions do resources :newsletter_subscriptions do
post :add collection do
post :add
end
end end
# USER MANAGEMENT # USER MANAGEMENT
+7
View File
@@ -1,3 +1,4 @@
=begin
require 'couch_potato' require 'couch_potato'
require 'simply_stored' require 'simply_stored'
require 'email_validator' require 'email_validator'
@@ -9,8 +10,14 @@ require 'tinymce-rails'
require 'paperclip' require 'paperclip'
require 'jquery-rails' require 'jquery-rails'
require 'bourbon' require 'bourbon'
=end
module Cmtool module Cmtool
class Engine < ::Rails::Engine class Engine < ::Rails::Engine
isolate_namespace Cmtool isolate_namespace Cmtool
initializer "cmtool" do
end
ActiveSupport.on_load(:action_view) do
::ActionView::Base.send :include, Cmtool::ApplicationHelper
end
end end
end end
+13
View File
@@ -0,0 +1,13 @@
require 'spec_helper'
describe Cmtool::PagesController do
describe 'GET index' do
it "should render standard view when tree is available" do
#binding.pry
create_pages_tree
->{ get :index }.should_not raise_error
end
end
end
+1 -1
View File
@@ -3,7 +3,7 @@ development:
database: cmtool database: cmtool
test: test:
validation_framework: :active_model #optional validation_framework: :active_model #optional
database: cmtool database: cmtool_test
production: production:
validation_framework: :active_model #optional validation_framework: :active_model #optional
database: cmtool database: cmtool
+10
View File
@@ -0,0 +1,10 @@
Dummy::Application.configure do
# Use Pry instead of IRB
silence_warnings do
begin
require 'pry'
IRB = Pry
rescue LoadError
end
end
end
+5
View File
@@ -19,6 +19,7 @@ Capybara.default_driver = :selenium
RSpec.configure do |config| RSpec.configure do |config|
config.mock_with :rspec config.mock_with :rspec
config.include FactoryGirl::Syntax::Methods config.include FactoryGirl::Syntax::Methods
#config.application = Cmtool::Engine
#config.include CompanyFactory #config.include CompanyFactory
config.include Cmtool::Engine.routes.url_helpers config.include Cmtool::Engine.routes.url_helpers
config.include Devise::TestHelpers, :type => :controller config.include Devise::TestHelpers, :type => :controller
@@ -35,6 +36,10 @@ RSpec.configure do |config|
#render_views #render_views
end end
config.before :each do
@routes = Cmtool::Engine.routes
end
config.before :all do config.before :all do
end end
config.before :each, type: :request do config.before :each, type: :request do