search for: user_spec

Displaying 20 results from an estimated 46 matches for "user_spec".

2012 May 24
0
Ruby on Rails Tutorial Chapter 6 RSpec tests failing
...ning by Example book (http://ruby.railstutorial.org/ chapters/modeling-users#sec:adding_a_secure_password). The following Chapter 6 RSpec tests are failing: Failures: 1) User [31mFailure/Error:[0m [31mit { should be_valid }[0m [31mexpected valid? to return true, got false[0m [36m # ./spec/models/ user_spec.rb:19:in `block (2 levels) in ''[0m 2) User when email format is valid should be valid [31mFailure/Error: [0m [31m-agIoKRwLymF0sw7Iq073Hg@public.gmane.org be_valid[0m [31mexpected valid? to return true, got false[0m [36m # ./spec/models/user_spec.rb:51:in block (4 levels) in <top (requi...
2008 Jan 31
4
reby-debug and rspec
How do I use the ruby debugger with a specific test (not the whole spec file)? I want to do something like this. $ rdebug spec/models/user_spec.rb -s "should error if not new_record" ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
2007 Oct 31
12
autotest displays no output
Hey, I''m trying to configure autotest with rspec on cygwin but something is going wrong. I made a very simple testing environment with a user.rb and user_spec.rb file. Rspec works fine, but autotest outputs nothing - it just stays here, idle. ^C doesn''t display anything more. I can see it''s running because I added require ''autotest/snarl'' in my .autotest file. And Snarl tells me "Autotest was started" when I...
2007 Jun 21
3
Sqlite3, in-memory db and rspec_server
...specs on my models pass. If I use an in-memory db for the test db, script/spec w/o spec_server, they all pass. But if I use in-memory and spec_server I get the following error: 1) ActiveRecord::StatementInvalid in ''User should be valid'' ActiveRecord::StatementInvalid ./spec/models/user_spec.rb:5:in `new'' ./spec/models/user_spec.rb:5: ./script/spec_server:23:in `run'' ./script/spec_server:44: Line 5 is the User.new in the before clause. I have tried this on various versions of things. RSpec 1.0.5, Ubuntu 6.04, Rails 1.2.3, Sqlite 3.2.8, sqlit3-ruby 1.2.1 (gem) And o...
2007 Aug 12
3
Scope and specing models
...than a spec issue at this point)... Here''s the error: ActiveRecord::AssociationTypeMismatch in ''A new User should know what role it has'' Role expected, got NilClass D:/ruby/projects/restful_authentication_test/config/../app/models/role.rb:5:in `add'' ./spec/models/user_spec.rb:62: script/spec:4: Here''s the user.rb http://pastie.caboo.se/87029 role.rb http://pastie.caboo.se/87030 user_spec.rb http://pastie.caboo.se/87032 The code is based off of RESTful authentication + Ben Curtis'' user roles in Rails Application: http://www.bencurtis.com/archives...
2009 Jun 13
2
removing Mocha; 'spec spec' fails but the specific model file passes
...pec_scaffold on a demo project. and ran into the problem of mixing mock frameworks...ryan uses mocha. So, as a learning experience, I choose to redo ryan''s tests without mocha but ran into a strange problem with tests of the User model. With debugging you can see.... If you run just the user_spec.rb file, everything is fine....rspec goes through the User model. However, if you run all the specs, it is somehow still using mocha instead of the User model. How is this possible since I removed the configuration for mocha.? In spec_helper.rb, I commented out the line: # config.mock_with :moc...
2007 Oct 17
16
rspec causing validates_presence_of to validate twice?
I had posted this on the regular Rails list, but upon trying this in script/console, it seems like the behavior only exists when running rspec. I''m getting some weird behavior in one of my models. I have a model defined something like this class User < ActiveRecord::Base attr_accessor :password validates_presence_of :password end If I validate the model without specifying a
2007 Mar 06
10
Windows rspec "gem install win32console"
Hi, Hi I am trying to use RSPEC on windows and i keep getting the following error "You must gem install win32console to use colour on Windows" I have installed this Gem but i am still getting the same error. The file that error is coming from is: C:\ruby\lib\ruby\gems\1.8\gems\rspec-0.8.2\lib\spec\runner\formatter\base_text_formatter.rb Do i need to put this line of code in? Where
2010 Aug 11
6
rspec2 not working with shoulda
I am using rails edge. I am using gem "rspec-rails", "= 2.0.0.beta. 19" . I have following code at spec/models/user_spec.rb require ''spec_helper'' describe User do it { should validate_presence_of(:email) } it { should validate_presence_of(:name) } end Here is my gemfile group :development, :test do gem ''factory_girl_rails'', :git => ''git://github.com/though...
2007 Feb 18
3
[0.8.0-RC1] problem with drbspec
I''m getting the following error with version 0.8.0 (I updated the gem and the rails plugin, and re-ran generate/rspec): c:\wd\clarks>drbspec spec/models/user_spec.rb c:/ruby/bin/drbspec:16:in `load'': no such file to load -- drbspec (LoadError) from c:/ruby/bin/drbspec:16 the same command works fine under 0.7.5.1. Windows XP, rails 1.2.2 and rubygems 0.9.1 -- View this message in context: http://www.nabble.com/-0.8.0-RC1--problem-with-drbs...
2007 Dec 10
2
Duplicate error messages
I am running rails 1.2.3 and rspec 1.0.8 on os X 10.4 and I am having a problem with one of my model specs (User class). For some reason rspec is throwing repeating errors. If the error I expect is "email is required", I end up getting it several times. What''s even more confusing, my spec passes without DRB, but with DRB is when all the multiple errors show up. At the moment I
2008 Jun 04
8
Not running correct specs under autotest:
...g this up: [["app/controllers/contents_controller.rb", Wed Jun 04 14:11:03 +0100 2008]] [["app/controllers/contents_controller.rb", Wed Jun 04 14:11:03 +0100 2008]] /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -S script/spec -O spec/spec.opts spec/models/user_spec.rb I had saved ''contents_controller.rb'' but it did not decide to re-run the ''contents_controller_spec.rb'' only ''user_spec.rb'' (which has a failing spec so is probably held over from the previous runs). If I ctrl+c to run all specs it runs the c...
2007 Jan 22
1
Observed models cause failures with DRBSpec ?
...shed in 0.125322 seconds 1 specification, 0 failures $ drbspec spec F 1) ''A user with an inactive and an active project should be able to return active projects only'' FAILED [] should == [#<Spec::Mocks::Mock:0xb75590bc @name="active", @options={}>] ./spec/models/user_spec.rb:11: script/rails_spec_server:17:in `run'' script/rails_spec_server:38: Finished in 0.024455 seconds 1 specification, 1 failure # spec/models/user_spec.rb require File.dirname(__FILE__) + "/../spec_helper" context "A user with an inactive and an active project" d...
2012 Nov 06
2
rspec failure upon revisit
...UsersHelper add some examples to (or delete) /Users/andrewchickedantz/rails_projects/sample_app/spec/helpers/users_helper_spec.rb # No reason given # ./spec/helpers/users_helper_spec.rb:14 User add some examples to (or delete) /Users/andrewchickedantz/rails_projects/sample_app/spec/models/user_spec.rb # No reason given # ./spec/models/user_spec.rb:4 users/new.html.erb add some examples to (or delete) /Users/andrewchickedantz/rails_projects/sample_app/spec/views/users/new.html.erb_spec.rb # No reason given # ./spec/views/users/new.html.erb_spec.rb:4 Failures: 1) LayoutLin...
2008 May 21
2
running rspec on 1.2.3 ??
...s and ran the command ruby script/generate rspec ==>>> Does this script work right? from the instructions http://rspec.info/documentation/rails/install.html I then created the directories in spec: controllers, fixtures, helpers, models, views I then created the file spec/models/user_spec.rb as a spec for my model User. Anyhow, my problem: I run rake spec and get /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'': no such file to load -- spec/rails (MissingSourceFile) The file /spec/spec_helper.rb contains the line require '...
2007 May 26
11
RSpec
...sets_controller_spec.rb" "spec/controllers/users_controller_spec.rb" "spec/helpers/user_assets_helper_spec.rb" "spec/helpers/user_assets_url_helpers_spec.rb" "spec/models/asset_spec.rb" "spec/models/authenticated_base_spec.rb" "spec/models/user_spec.rb" "spec/views/assets/edit_rhtml_spec.rb" "spec/views/assets/index_rhtml_spec.rb" "spec/views/assets/new_rhtml_spec.rb" "spec/views/assets/show_rhtml_spec.rb" "spec/views/users/edit_rhtml_spec.rb" "spec/views/users/index_rhtml_spec.rb&quo...
2011 Jul 25
7
Adding a folder to my rspec execution path
Hi guys, I''m using RSpec with Capybara, and for that I created the spec/integration folder. But when I execute the command "bundle exec rspec spec" RSpec don''t execute my files on integration folder. I need to pass each file to solve this problem. Do you known how I can put the integration folder on rspec execution path without need to pass each file? Thanks, Pablo
2007 Apr 09
7
RCov results seem to include the spec files
...pec:rcov") do |t| t.spec_files = FileList["spec/**/*_spec.rb"] t.rcov = true end When I run rake spec:rcov, it runs the specs using RCov and generates the reports, but it''s including all my spec files as well. At the very bottom I''ll see stuff like spec/models/user_spec.rb 89 73 100.0% it even includes spec_helper.rb! I don''t really care to know that my specs are covered :) Here''s the command that''s being run as a result of the rake task: /usr/local/bin/ruby -I"/usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib" -S...
2008 Jan 11
1
testing modules
I''ve developed a module to include in ActiveRecord derived classes. Can I test the module without having to tie it to a particular class? atm, I''m including it in my User class and writing the tests in user_spec.rb, but I don''t like the idea of tying the module tests to those of the class. I may extract the specs to a shared description and include that in the specs for each model which uses the module. is that the right way to do it? I''d appreciate any thoughts or suggestions neil --...
2007 May 25
0
still seeing strange behaviour with spec_server
...e running specs and the command itself was running slowly. I''ve since tried it on a new system with a clean install of ubuntu 7.04, rails 1.2.3 and rspec 1.0.2 and I''m seeing the same behavior. *** without spec_server *** x at holly:~/rails/test$ time ruby script/spec spec/models/user_spec.rb . Finished in 0.08807 seconds 1 example, 0 failures real 0m2.042s user 0m1.544s sys 0m0.260s *** with spec_server running and the --drb option *** x at holly:~/rails/test$ time ruby script/spec spec/models/user_spec.rb --drb Finished in 1.5e-05 seconds 0 examples, 0 failures re...