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