[rspec-users] RSpec

Courtenay court3nay at gmail.com
Tue Jun 12 06:32:57 EDT 2007


The app is now updated to 1.0.4 or thereabouts.

On 5/26/07, Omen King <omen.king at gmail.com> wrote:
> He's really lazy,
>
> I've updated the spec_helper.rb and translated the spec.
> I'm getting different errors now such as:
>
> 1)
> NoMethodError in 'Requesting /assets/1;edit using GET should render
> edit.rhtml'
> undefined method `render?' for
> #<UserAssetsController:0x32b5978>
> ./spec/controllers/user_assets_controller_spec.rb:201:
>
> and
>
> 5)
> NoMethodError in '/users/edit.rhtml should render edit form'
> undefined method `matches?' for #<Hash:0x3328edc>
> ./spec/views/users/edit_rhtml_spec.rb:21:
>
> I'm not too certain why it isn't seeing matches but I'll have to do more
> digging.
>
> I love caboo.se!
>
>
>
>
> On 5/26/07, Courtenay <court3nay at gmail.com> wrote:
> > Heh.  The author is lazy and hasn't upgraded his sample apps to latest
> rspec.
> > Also, you didn't load the database schema;
> >
> >    rake db:migrate
> >
> > Patches are, of course, always welcome.
> >
> > Courtenay (the lazy author)
> > http://blog.caboo.se
> >
> >
> > On 5/26/07, aslak hellesoy < aslak.hellesoy at gmail.com> wrote:
> > > The app you downloaded is not compatible with rspec 1.0. Please
> > > contact the app authors or upgrade it yourself. See upgrading on the
> > > rspec website.
> > >
> > > On 5/26/07, Omen King <omen.king at gmail.com> wrote:
> > > > So I can run rake spec. I've gotten errors and I not too sure what I'm
> > > > looking at.
> > > >
> > > > Lets take a look at error 1:
> > > > ===================================================
> > > >   specify "should render new" do
> > > >     controller.should_render :new
> > > >     get :new
> > > >   end
> > > >
> > > > 1)
> > > > NoMethodError in '/session/new GET should render new'
> > > > undefined method `should_render' for #<SessionController:0x34ea018>
> > > > ./spec/controllers/session_controller_spec.rb:7:
> > > > ===================================================
> > > > Is it trying to called a method called 'should_render' for
> > > > session_controller of session_controller_spec?
> > > >
> > > > 2)
> > > > NameError in '/session POST without remember me should authenticate
> user'
> > > > undefined local variable or method `mock_user' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x3443c40>
> > > > ./spec/controllers/session_controller_spec.rb:15:
> > > >
> > > > 3)
> > > > NameError in '/session POST without remember me should login user'
> > > > undefined local variable or method `mock_user' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x3443c40>
> > > > ./spec/controllers/session_controller_spec.rb:15:
> > > >
> > > > 4)
> > > > NameError in '/session POST without remember me should not remember
> me'
> > > > undefined local variable or method `mock_user' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x3443c40>
> > > > ./spec/controllers/session_controller_spec.rb:15:
> > > >
> > > > 5)
> > > > NameError in '/session POST without remember me should redirect to
> root'
> > > > undefined local variable or method `mock_user' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x3443c40>
> > > > ./spec/controllers/session_controller_spec.rb:15:
> > > >
> > > > 6)
> > > > NameError in '/session POST with remember me should remember me'
> > > > undefined local variable or method `mock_user' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x34409c8>
> > > > ./spec/controllers/session_controller_spec.rb:44:
> > > >
> > > > 7)
> > > > NameError in '/session POST with remember me should create cookie'
> > > > undefined local variable or method `mock_user' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x34409c8>
> > > > ./spec/controllers/session_controller_spec.rb:44:
> > > >
> > > > 8)
> > > > NameError in '/session POST when invalid should authenticate user'
> > > > undefined local variable or method `mock_user' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x343e0c4>
> > > > ./spec/controllers/session_controller_spec.rb:72:
> > > >
> > > > 9)
> > > > NameError in '/session POST when invalid should login user'
> > > > undefined local variable or method `mock_user' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x343e0c4>
> > > > ./spec/controllers/session_controller_spec.rb:72:
> > > >
> > > > 10)
> > > > NameError in '/session POST when invalid should not remember me'
> > > > undefined local variable or method `mock_user' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x343e0c4>
> > > > ./spec/controllers/session_controller_spec.rb:72:
> > > >
> > > > 11)
> > > > NameError in '/session POST when invalid should render new'
> > > > undefined local variable or method `mock_user' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x343e0c4>
> > > > ./spec/controllers/session_controller_spec.rb:72:
> > > >
> > > > 12)
> > > > NameError in '/session DELETE should get current user'
> > > > undefined local variable or method `mock_user' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x343abe0>
> > > > ./spec/controllers/session_controller_spec.rb:102:
> > > >
> > > > 13)
> > > > NameError in '/session DELETE should forget current user'
> > > > undefined local variable or method `mock_user' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x343abe0>
> > > > ./spec/controllers/session_controller_spec.rb:102:
> > > >
> > > > 14)
> > > > NameError in '/session DELETE should delete token on logout'
> > > > undefined local variable or method `mock_user' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x343abe0>
> > > > ./spec/controllers/session_controller_spec.rb:102:
> > > >
> > > > 15)
> > > > NameError in '/session DELETE should reset session'
> > > > undefined local variable or method `mock_user' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x343abe0>
> > > > ./spec/controllers/session_controller_spec.rb:102:
> > > >
> > > > 16)
> > > > NameError in '/session DELETE should redirect to root'
> > > > undefined local variable or method `mock_user' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x343abe0>
> > > > ./spec/controllers/session_controller_spec.rb:102:
> > > >
> > > > 17)
> > > > NoMethodError in 'Requesting /assets using GET should render
> index.rhtml'
> > > > undefined method `should_render' for
> #<UserAssetsController:0x3388224>
> > > > ./spec/controllers/user_assets_controller_spec.rb:25:
> > > >
> > > > 18)
> > > > NoMethodError in 'Requesting /assets/1 using GET should render
> show.rhtml'
> > > > undefined method `should_render' for
> #<UserAssetsController:0x3285cb4>
> > > > ./spec/controllers/user_assets_controller_spec.rb:93:
> > > >
> > > > 19)
> > > > NoMethodError in 'Requesting /assets/new using GET should render
> new.rhtml'
> > > > undefined method `should_render' for
> #<UserAssetsController:0x31659d8>
> > > >
> ./spec/controllers/user_assets_controller_spec.rb:159:
> > > >
> > > > 20)
> > > > NoMethodError in 'Requesting /assets/1;edit using GET should render
> > > > edit.rhtml'
> > > > undefined method `should_render' for
> #<UserAssetsController:0x30e4a40>
> > > >
> ./spec/controllers/user_assets_controller_spec.rb:201:
> > > >
> > > > 21)
> > > > NoMethodError in 'Requesting /users using GET should render
> index.rhtml'
> > > > undefined method `should_render' for #<UsersController:0x330507c>
> > > > ./spec/controllers/users_controller_spec.rb:49:
> > > >
> > > > 22)
> > > > NoMethodError in 'Requesting /users/1 using GET should render
> show.rhtml'
> > > > undefined method `should_render' for #<UsersController:0x3237ff0>
> > > > ./spec/controllers/users_controller_spec.rb:112:
> > > >
> > > > 23)
> > > > NoMethodError in 'Requesting /users/new using GET should render
> new.rhtml'
> > > > undefined method `should_render' for #<UsersController:0x3169650>
> > > > ./spec/controllers/users_controller_spec.rb:175:
> > > >
> > > > 24)
> > > > ActiveRecord::StatementInvalid in 'Requesting /users/1;edit using GET
> should
> > > > fail if current user doesn't match'
> > > > Mysql::Error: #42S02Table 'sample_test.users' doesn't exist: SHOW
> FIELDS
> > > > FROM users
> > > >
> /Users/multimedia/Desktop/rest_org/config/../lib/ar_extensions.rb:27:in
> > > > `log'
> > > > ./spec/controllers/users_controller_spec.rb:209:in
> `new'
> > > > ./spec/controllers/users_controller_spec.rb:209:
> > > >
> > > > 25)
> > > > NoMethodError in 'Requesting /users/1;edit using GET should render
> > > > edit.rhtml'
> > > > undefined method `should_render' for #<UsersController:0x30fdb80>
> > > > ./spec/controllers/users_controller_spec.rb:221:
> > > >
> > > > 26)
> > > > NoMethodError in 'the UserAssetsHelper should return user login name'
> > > > undefined method `should_eql' for "JoeLogin":String
> > > > ./spec/helpers/user_assets_helper_spec.rb:11:
> > > >
> > > > 27)
> > > > NameError in 'the generated url helpers for UserAssetsController
> should
> > > > return assets path given no arguments'
> > > > undefined local variable or method `controller' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x33860b4>
> > > > (eval):2:in `assets_path'
> > > > ./spec/helpers/user_assets_url_helpers_spec.rb:24:
> > > >
> > > > 28)
> > > > NameError in 'the generated url helpers for UserAssetsController
> should
> > > > return assets path given explicit argument'
> > > > undefined local variable or method `controller' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x33860b4>
> > > > (eval):2:in `assets_path'
> > > > ./spec/helpers/user_assets_url_helpers_spec.rb:28:
> > > >
> > > > 29)
> > > > NameError in 'the generated url helpers for UserAssetsController
> should
> > > > return asset path'
> > > > undefined local variable or method `controller' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x33860b4>
> > > > (eval):2:in `asset_path'
> > > > ./spec/helpers/user_assets_url_helpers_spec.rb:32:
> > > >
> > > > 30)
> > > > NameError in 'the generated url helpers for UserAssetsController
> should
> > > > return edit_asset path'
> > > > undefined local variable or method `controller' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x33860b4>
> > > > (eval):2:in `edit_asset_path'
> > > > ./spec/helpers/user_assets_url_helpers_spec.rb:36:
> > > >
> > > > 31)
> > > > NameError in 'the generated url helpers for UserAssetsController
> should
> > > > return new_asset path'
> > > > undefined local variable or method `controller' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x33860b4>
> > > > (eval):2:in `new_asset_path'
> > > > ./spec/helpers/user_assets_url_helpers_spec.rb:40:
> > > >
> > > > 32)
> > > > NameError in 'the generated url helpers for UserAssetsController
> should
> > > > return asset_attachable path'
> > > > undefined local variable or method `controller' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x33860b4>
> > > > (eval):2:in `asset_attachable_path'
> > > > ./spec/helpers/user_assets_url_helpers_spec.rb:44:
> > > >
> > > > 33)
> > > > ActiveRecord::StatementInvalid in 'Given a generated asset_spec.rb
> with
> > > > fixtures loaded fixtures should load two Assets'
> > > > ActiveRecord::StatementInvalid: Mysql::Error: #42S02Table
> > > > 'sample_test.assets' doesn't exist: DELETE FROM assets: DELETE FROM
> assets
> > > >
> /Users/multimedia/Desktop/rest_org/config/../lib/ar_extensions.rb:27:in
> > > > `log'
> > > >
> /Users/multimedia/Desktop/rest_org/vendor/plugins/rspec_on_rails/lib/spec/rails/dsl/behaviour/model.rb:12:in
> > > > `before_eval'
> > > >
> > > > 34)
> > > > ActiveRecord::StatementInvalid in 'A User abstract class should have
> valid
> > > > associations'
> > > > Mysql::Error: #42S02Table 'sample_test.users' doesn't exist: SHOW
> FIELDS
> > > > FROM users
> > > >
> /Users/multimedia/Desktop/rest_org/config/../lib/ar_extensions.rb:27:in
> > > > `log'
> > > > ./spec/models/authenticated_base_spec.rb:7:in `new'
> > > > ./spec/models/authenticated_base_spec.rb:7:
> > > >
> > > > 35)
> > > > ActiveRecord::StatementInvalid in 'An existing user should
> authenticate with
> > > > new or reset password'
> > > > Mysql::Error: #42S02Table 'sample_test.users' doesn't exist: SHOW
> FIELDS
> > > > FROM users
> > > >
> /Users/multimedia/Desktop/rest_org/config/../lib/ar_extensions.rb:27:in
> > > > `log'
> > > > ./spec/models/authenticated_base_spec.rb:14:
> > > >
> > > > 36)
> > > > ActiveRecord::StatementInvalid in 'An existing user should not rehash
> > > > password on login change'
> > > > Mysql::Error: #42S02Table 'sample_test.users' doesn't exist: SHOW
> FIELDS
> > > > FROM users
> > > >
> /Users/multimedia/Desktop/rest_org/config/../lib/ar_extensions.rb:27:in
> > > > `log'
> > > > ./spec/models/authenticated_base_spec.rb:14:
> > > >
> > > > 37)
> > > > ActiveRecord::StatementInvalid in 'An existing user should remember
> token'
> > > > Mysql::Error: #42S02Table 'sample_test.users' doesn't exist: SHOW
> FIELDS
> > > > FROM users
> > > >
> /Users/multimedia/Desktop/rest_org/config/../lib/ar_extensions.rb:27:in
> > > > `log'
> > > > ./spec/models/authenticated_base_spec.rb:14:
> > > >
> > > > 38)
> > > > ActiveRecord::StatementInvalid in 'An existing user should increment
> hit
> > > > counter'
> > > > Mysql::Error: #42S02Table 'sample_test.users' doesn't exist: SHOW
> FIELDS
> > > > FROM users
> > > >
> /Users/multimedia/Desktop/rest_org/config/../lib/ar_extensions.rb:27:in
> > > > `log'
> > > > ./spec/models/authenticated_base_spec.rb:14:
> > > >
> > > > 39)
> > > > ActiveRecord::StatementInvalid in 'An existing user should forget
> token'
> > > > Mysql::Error: #42S02Table 'sample_test.users' doesn't exist: SHOW
> FIELDS
> > > > FROM users
> > > >
> /Users/multimedia/Desktop/rest_org/config/../lib/ar_extensions.rb:27:in
> > > > `log'
> > > > ./spec/models/authenticated_base_spec.rb:14:
> > > >
> > > > 40)
> > > > ActiveRecord::StatementInvalid in 'An existing user should be
> remembered for
> > > > a period'
> > > > Mysql::Error: #42S02Table 'sample_test.users' doesn't exist: SHOW
> FIELDS
> > > > FROM users
> > > >
> /Users/multimedia/Desktop/rest_org/config/../lib/ar_extensions.rb:27:in
> > > > `log'
> > > > ./spec/models/authenticated_base_spec.rb:14:
> > > >
> > > > 41)
> > > > NoMethodError in 'A new user should create'
> > > > undefined method `should_change' for
> > > >
> #<Proc:0x032a468c at ./spec/models/authenticated_base_spec.rb:59>
> > > > ./spec/models/authenticated_base_spec.rb:59:
> > > >
> > > > 42)
> > > > NoMethodError in 'A new user should require login'
> > > > undefined method `should_not_change' for
> > > >
> #<Proc:0x032a4330 at ./spec/models/authenticated_base_spec.rb:63>
> > > > ./spec/models/authenticated_base_spec.rb:63:
> > > >
> > > > 43)
> > > > NoMethodError in 'A new user should require password'
> > > > undefined method `should_not_change' for
> > > >
> #<Proc:0x032a3fd4 at ./spec/models/authenticated_base_spec.rb:68>
> > > > ./spec/models/authenticated_base_spec.rb:68:
> > > >
> > > > 44)
> > > > NoMethodError in 'A new user should require password confirmation'
> > > > undefined method `should_not_change' for
> > > >
> #<Proc:0x032a3c8c at ./spec/models/authenticated_base_spec.rb:73>
> > > > ./spec/models/authenticated_base_spec.rb:73:
> > > >
> > > > 45)
> > > > NoMethodError in 'A new user should require email'
> > > > undefined method `should_not_change' for
> > > >
> #<Proc:0x032a3944 at ./spec/models/authenticated_base_spec.rb:78>
> > > > ./spec/models/authenticated_base_spec.rb:78:
> > > >
> > > > 46)
> > > > ActiveRecord::StatementInvalid in 'A User should have valid
> associations'
> > > > Mysql::Error: #42S02Table 'sample_test.users' doesn't exist: SHOW
> FIELDS
> > > > FROM users
> > > >
> /Users/multimedia/Desktop/rest_org/config/../lib/ar_extensions.rb:27:in
> > > > `log'
> > > > ./spec/models/user_spec.rb:7:in `new'
> > > > ./spec/models/user_spec.rb:7:
> > > >
> > > > 47)
> > > > ActiveRecord::StatementInvalid in 'A User should protect against
> updates to
> > > > secure attributes'
> > > > Mysql::Error: #42S02Table 'sample_test.users' doesn't exist: SHOW
> FIELDS
> > > > FROM users
> > > >
> /Users/multimedia/Desktop/rest_org/config/../lib/ar_extensions.rb:27:in
> > > > `log'
> > > > ./spec/models/user_spec.rb:7:in `new'
> > > > ./spec/models/user_spec.rb:7:
> > > >
> > > > 48)
> > > > NoMethodError in '/assets/edit.rhtml should render edit form'
> > > > undefined method `should_have_tag' for
> > > > #<ActionController::TestResponse:0x323a980>
> > > > ./spec/views/assets/edit_rhtml_spec.rb:36:
> > > >
> > > > 49)
> > > > NoMethodError in '/assets/index.rhtml should render list of assets'
> > > > undefined method `should_have_tag' for
> > > > #<ActionController::TestResponse:0x31be0c4>
> > > > ./spec/views/assets/index_rhtml_spec.rb:49:
> > > >
> > > > 50)
> > > > NoMethodError in '/assets/new.rhtml should render new form'
> > > > undefined method `should_have_tag' for
> > > > #<ActionController::TestResponse:0x315040c>
> > > > ./spec/views/assets/new_rhtml_spec.rb:39:
> > > >
> > > > 51)
> > > > NoMethodError in '/users/edit.rhtml should render edit form'
> > > > undefined method `should_have_tag' for
> > > > #<ActionController::TestResponse:0x30f1d08>
> > > > ./spec/views/users/edit_rhtml_spec.rb:21:
> > > >
> > > > 52)
> > > > NameError in '/users/new.rhtml should render new form'
> > > > undefined local variable or method `mock_user' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x31d99c8>
> > > > ./spec/views/users/new_rhtml_spec.rb:10:
> > > >
> > > > 53)
> > > > NameError in '/users/show.rhtml should render attributes in <p>'
> > > > undefined local variable or method `mock_user' for [Dynamically
> generated
> > > > class for RSpec example]:#<Class:0x31c6cc4>
> > > > ./spec/views/users/show_rhtml_spec.rb:7:
> > > >
> > > > Finished in 2.492637 seconds
> > > >
> > > > 117 examples, 53 failures
> > > >
> > > _______________________________________________
> > > rspec-users mailing list
> > > rspec-users at rubyforge.org
> > > http://rubyforge.org/mailman/listinfo/rspec-users
> > >
> > _______________________________________________
> > rspec-users mailing list
> > rspec-users at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/rspec-users
> >
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list