similar to: My first rspec reports "undefined method `key?' for #<String:0x46b1df0>"

Displaying 20 results from an estimated 700 matches similar to: "My first rspec reports "undefined method `key?' for #<String:0x46b1df0>""

2009 Feb 21
10
Problem with test_truth
hello all, i have a problem with test_truth. require ''test_helper'' class MyDataTest < ActiveSupport::TestCase def test_truth assert true end end this should ok without failures or errors. but it failure: 1) Error: test_truth(MyDataTest): ActiveRecord::StatementInvalid: Mysql::Error: Table ''alldataserver_test.members'' doesn''t exist: DELETE
2008 Jun 12
1
map.resources :foo_items, :as => :foo confusing my controller specs
I have following resource defined in my config/routes.rb (the model name is contrived) map.resources :foo_items, :as => :foo that I originally generated with rspec_scaffold: ruby script/generate rspec_scaffold foo_item but when I use the :as attribute in resources to make the URI path be ''/foo'' instead of ''/foo_items'' the default/generated controller
2008 Dec 05
3
2 forms in one page,how to arrange the code and do it restful?
Backgroup: Customer has many old documents(just some scanning pictures) and want to store them into computer,we need to input the doc and relate them to the existing authors in DB. Key works: document;author UI of document input page: left side is the document input form right side is the author search form Problem: How should i arrange the code to deal with it. I have 2 solutions, but i do not
2007 Dec 18
2
rpec_scaffold and nested resources
I''ve got a love-hate relationship with script/generate rspec_scaffold If you are using non-nested controllers/resources it''s great. I love the spec skeletons it generates. But I find myself doing this, where Y is and existing set of model/controller ... representing a resource: 1) script/generate rspec_scaffold x .... At this point rake spec passes. 2) edit config/routes.rb
2007 Jul 26
2
rspec_resource error
First of all hi, I''m new to the list, and rather new to rspec as will probably show in myquestion. I have tried installing rspec and rspec_on_rails as plugs both using "script/install" and "piston import" commands using the "current release install instructions" here [1]. However, there doesn''t seem to be any mention of the rspec_resource
2008 Oct 09
1
About received unexpected message :code with (no args)
I use rspec_scaffold to generate a part of examples as below: it "should expose a newly created awarding_body as @awarding_body" do AwardingBody.should_receive(:new).with({''these'' => ''params''}).and_return(mock_awarding_body(:save => true)) post :create, :awarding_body => {:these => ''params''}
2008 Jan 26
0
RSpec and resource_controller plugin
I just discovered James Golick''s resource_controller plugin http://jamesgolick.com/resource_controller after spending another stretch of boredom making the changes to nest yet another rails resource controller. I''d actually slowed down this time to think about what I was doing in hopes of automating the task. I''ve tended to use script/generate rspec_scaffold to get
2007 Aug 16
17
undefined method `mock_model'' for [RSpec example]:#<Class:0x25550a8>
I am getting: undefined method `mock_model'' for [RSpec example]:#<Class:0x25550a8> with my view specs after upgrading to 1.0.8. Is anyone else seeing this? To isolate the message I did the following setup: - create new rails project (with edge) - installed rspec and rspec_on_rails - ran rake spec - ran script/generate rspec_scaffold products - tried to run a builtin view
2007 Jul 26
5
Coding standards and whitespace
Recently as a result of using Git I''ve noticed a number of inconsistencies in the RSpec codebase with respect to whitespace (mixed line endings, mixed use of spaces and tabs for indentation, and trailing whitespace at the end of lines). I never would have noticed, but Git produces nice colorized diff output which highlights these kinds of inconsistencies. I wanted to ask if the
2008 Jan 23
2
integrate_views is not executing my views
I wanted to use "integrate_views" as Ryan explains in his RailsCast #71 (http://railscasts.com/episodes/71) ...but I can''t get it to work: the view code in not executed I looked everywhere but I can''t understand what I am doing wrong. Here is what I did: I created a new application from scratch (Rails 2.0.2), added rspec and rspec_on_rails plugins, and run
2009 Jun 13
2
removing Mocha; 'spec spec' fails but the specific model file passes
I happened to mix ryan bates'' authentication scaffold with rspec_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
2008 Jul 05
5
Does RSpec work nicely with UUID primary keys?
I have my application happily generating UUID primary keys using the uuidtools gem. But the auto-generated specifications created by "script/generate rspec_scaffold...", etc, assume that one is using a sequential integer primary key. For those who have hit this same issue, is it just a matter of rewriting the auto-generated specifications to take this into account, or does one have to
2008 Sep 12
1
restful_authentication rspec failures "Mysql::Error: Incorrect datetime value:"
I am getting 193 failures that all have "Mysql::Error: Incorrect datetime value:" how do i fix this??? i am new to rspec and restful_auth, so if i am doing something wrong, let me know!!! windows xp rails 2.1.1 rails testproject cd testproject # create my databases and edit database.yml git init git submodule add git://github.com/dchelimsky/rspec.git vendor/plugins/ rspec git
2009 Jan 16
3
rspec model testing - test on user defined validation- How do I test that the create failed.
I''m new to rspec and looking for way to test a validation I added to a model. The test checks to see that if field1 has a value then field2 must be nil and vice versa. ------------------------------- When I did the rspec_scaffold it generated one test which worked before :each do @valid_attributes = { :field1 = "value for field1" :field2 = "value for
2007 Jul 26
0
rspec_on_rails magical incantations
I ran into something really puzzling today. I don''t know exactly why it''s happening, but I thought I''d share my experiences. I started a dummy app just to test an idea outside of the context of my real work today. So, I quickly get things started: * rails junk * cd junk * ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/ CURRENT/rspec * ruby
2008 Jan 16
2
rspec_on_rails_matchers
All, Sorry for spamming this list about this but I think everyone who could help me with this problem is on this list... If there is a better place to post this question let me know. Anyways, I am trying to use rspec_on_rails_matchers in my rails app to improve my view specs but I can''t get them to work. The helpers for the form tags never seem to be called. I created a new Rails
2008 Aug 11
1
Confused about square bracket usage.
I ran script/generate rspec_scaffold page title:string body:text and have been reading on the generated code in my spare time in an attempt to fully understand rspec. It mostly makes a lot of sense except for the square brackets in the snippet below. To my best understanding, [mock_page] would be an array containing mock_page. That almost makes sense, buy why wouldn''t the variable
2009 Apr 30
1
rake spec - no output
rake spec does not seem to be doing anything. Could it be a problem with ruby 1.9? Here is what I did: rails rspec-test cd rspec-test test.rb: config.gem "rspec", :lib => false, :version => ">= 1.2.0" test.rb: config.gem "rspec-rails", :lib => false, :version => ">= 1.2.0" ruby script/generate rspec ruby script/generate rspec_scaffold
2008 Oct 09
1
When i use rspec(with built-in mock framework) ,errof occurs
I use rspec_scaffold generate a example as below: it "should expose a newly created awarding_body as @awarding_body" do AwardingBody.should_receive(:new).with(:these =>''params'').and_return(mock_awarding_body(:save => true)) post :create, :awarding_body => {:these => ''params''}
2009 Mar 15
0
rspec-rails 1.2.0 Released
rspec-rails version 1.2.0 has been released! * <http://rspec.info/> * <http://wiki.github.com/dchelimsky/rspec> * <http://wiki.github.com/dchelimsky/rspec/rails> * <http://wiki.github.com/dchelimsky/rspec/upgrades> Behaviour Driven Development for Ruby on Rails. Changes: ### Version 1.2.0 IMPORTANT INFORMATION: Due to changes in Rails-2.3, there are some changes in