--- On Mon, 6/10/13, David Chelimsky-2 [via Ruby]
<ml-node+s11n4991635...@n6.nabble.com> wrote:
From: David Chelimsky-2 [via Ruby] <ml-node+s11n4991635...@n6.nabble.com>
Subject: Re: <help> renders new/edit user_mst form
To: "oliver" <oliverjesus2...@yahoo.com>
Date: Monday, June 10, 2013, 9:57 AM
On Mon, Jun 10, 2013 at 4:39 AM, oliver <[hidden email]> wrote:
def new
@user_mst = UserMst.new
@group_mst = GroupMst.all
Under normal circumstances, this line ^^ would assign @group_mst an empty
collection, not nil, so something is wrong with the way things are set
up/configured.
What happens if you stub GroupMst.all in the spec:
GroupMst.stub(:all => [])
Please try that and then run just one example like this:
rspec spec/views/user_msts/new.html.erb_spec.rb:18 --backtrace
And then post the complete output.
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @user_mst }
end
end
Those are the lines I include @group_mst.
_______________________________________________
rspec-users mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/rspec-users
If you reply to this email, your message will be added to the
discussion below:
http://ruby.11.x6.nabble.com/help-renders-new-edit-user-mst-form-tp4991623p4991635.html
To unsubscribe from <help> renders new/edit user_mst form,
click here.
NAML
late.rb:127:in `render' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.0.9/lib/action_view/render/rendering.rb:59:in
`block in _render_template' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.9/lib/active_support/notifications.rb:52:in
`block in instrument' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.9/lib/active_support/notifications/instrumenter.rb:21:in
`instrument' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.9/lib/active_support/notifications.rb:52:in
`instrument' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.0.9/lib/action_view/render/rendering.rb:56:in
`_render_template' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.0.9/lib/action_view/render/rendering.rb:26:in
`render' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.0.9/lib/action_view/test_case.rb:107:in
`render' # ./spec/views/user_msts/new.html.erb_spec.rb:20:in `block (2
levels) in <top
(required)>' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example.rb:48:in
`instance_eval' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example.rb:48:in
`block in run' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example.rb:107:in
`with_around_hooks' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example.rb:45:in
`run' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:294:in
`block in run_examples' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:290:in
`map' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:290:in
`run_examples' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:262:in
`run' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:24:in
`block (2 levels) in run' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:24:in
`map' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:24:in
`block in run' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/reporter.rb:12:in
`report' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:21:in
`run' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:80:in
`run_in_process' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:69:in
`run' #
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:11:in
`block in autorun'
Finished in 0.67188 seconds1 example, 1 failure
Failed examples:
rspec ./spec/views/user_msts/new.html.erb_spec.rb:19 # user_msts/new.html.erb
renders new user_mst form
That is the output.
--
View this message in context:
http://ruby.11.x6.nabble.com/help-renders-new-edit-user-mst-form-tp4991623p4991637.html
Sent from the rspec-users mailing list archive at Nabble.com.
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users