Displaying 20 results from an estimated 400 matches similar to: "undefined method `assigns' and undefined method `post'"
2011 Mar 09
1
undefined method `flunk' for #<Spec::Example::ExampleGroup::Subclass_1:0x0000000516bd40>
I''m running into an issue using ONLY rspec version 1.3.3 (no rails /
rspec-rails with this project) where i''m hitting the following error:
My code looks like this:
describe Win32Meterpreter
before :all
helper_method
end
def helper_method
## If a session came back, try to interact with it.
if @session
2008 Feb 22
7
Testing misc methods in ApplicationController
I''m already successfully testing before_filters in application_controller
courtesy of this blog post:
http://www.movesonrails.com/articles/2008/01/23/spec-ing-your-application-controller
However, i can;''t work out how to test the sort of method that is added to
application_controller so that all controllers can use it. It must be
something simple that i''m doing
2011 Jul 05
7
error of "rake test" command
Hi,
I have an error when i use rake test, plz help
akyen@ubuntu:~/Desktop/p$ rake test
WARNING: Global access to Rake DSL methods is deprecated. Please
include
... Rake::DSL into classes and modules which use the Rake DSL
methods.
WARNING: DSL method Pictographs::Application#task called at /usr/local/
lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:
215:in
2010 Jul 03
0
rspec controller test strange error: undefined method `call' for nil:NilClass
must be doing something dumb....
not sure, but the ''call'' appears to be on the block.call when the
respond_to block gets executed.
straight forward "channels" resource with a ''create'' action.... only
new thing is just assigning the current_user to the model.
def create
@channel = Channel.new(params[:channel])
@channel.user = @user
2011 Jul 11
36
has_many and belongs_to association
Hi ,
I want to test the one below but I got the problem
belongs_to :name, :class_name => "Phrase", :foreign_key => "name"
in my test
context "test"do
should have_many :phrases
end
in language.rb
belongs_to :name, :class_name => "Phrase", :foreign_key => "name"
error is
1) Failure:
test: check has_many and belongs_to
2007 Dec 14
13
RSpec-1.1.0 is released
The RSpec Development Team is pleased as glug (that''s kind of like
punch, but more festive) to announce RSpec-1.1.0.
Thanks to all who have contributed patches over the last few months.
Big thanks to Dan North and Brian Takita for their important work on
this release. Dan contributed his rbehave framework which is now the
Story Runner. Brian patiently did a TON of refactoring around
2011 Jun 30
8
Error of DEPRECATION WARNING
Hi,
I Have a strange error when i type the command "rake db:migrate "
Can you help to solve this error or give me some advices
the error is:
DEPRECATION WARNING: Rake tasks in /home/joanne/Desktop/picto/vendor/
plugins/prawnto/tasks/prawnto_tasks.rake are deprecated. Use lib/tasks
instead. (called from <top (required)> at /home/joanne/Desktop/picto/
Rakefile:7)
thanks for help
2008 Jan 02
2
Proxies
I really like the idea of Mock Proxies as explained in Brian Takita''s post here:
http://pivots.pivotallabs.com/users/brian/blog/articles/352-introducing-rr
I posted to this list eariler with an incomplete implementation of
.stops_mocking in the thread "Mocking Time, delegating to original
object." The Mock Proxy pattern would make this simpler.
2010 May 27
3
as_null_object
Given that RSpec has the following methods to create test doubles ...
double(:my_test_double)
mock(:my_mock_object)
stub(:my_stub)
Is there a way to/ plans to introduce a similar syntax for null
objects?
null_object(:my_null_object)
Instead of mock(:bar, :is_null_object => true) or
mock(:foo).as_null_object
I think this would be cleaner, what do you think?
2007 Dec 27
5
ExampleGroup and SharedExampleGroup relationship(?)
I''m working on a series going over the source code for rspec, and I ran into
something interesting with ExampleGroup and SharedExampleGroup. I was
wondering if anyone could shed light on it.
[NOTE: I''m working through the code for my own edification in learning Ruby.
Ruby has some features that I think are incredibly cool, so I''m using a
concrete implementation (RSpec)
2011 May 14
1
RSpec stub question
Hi
I am using Mongoid. In Mongoid while saving a record we typically give
like in the controller
@post.safely.save
For a model class Post
I am writing rspecs for my controller and want to mock the model. So
what I am doing is
let(:post) { mock_model(Post).as_null_object }
before(:each) do
Post.stub(:new).and_return(post)
end
it "creates new post"
2013 Mar 02
0
Problems getting rspec testing working in OSX?
Hey Gang,
Running into a weird error when trying to follow puppetlabs'' blog:
https://puppetlabs.com/blog/the-next-generation-of-puppet-module-testing/
I''m running 10.8.2, using default ruby, in an attempt to make my home env a little more sane, (ran into weird rbenv issues at work, which I won''t go into here)
The google tells me not a whole lot. Appreciate any help
2011 Jul 05
4
Problem of "rake spec"
Hi all,
I am a bit confused when i type rake spec and it gives me this
message,
No examples matching ./spec/**/*_spec.rb could be found
what is that mean that something is not found.
and where i can input my the test code because i did have a tiny
sample code in user_controller_test.rb.
is that the right place to test functional..
plz give me a help
thanks
--
You received this message
2009 May 23
9
undefined method `assert_select'
I''m having trouble getting the specs to run for a plugin where I want to
fix a bug. (I''ve actually already found and fixed the bug, but I don''t
want to submit a fix without a test!) When I started the specs weren''t
running, but it may be that I''m using Rails 2.3.3 and the plugin has
been tested on 2.1 and earlier. I went through writing a spec for a
2007 Nov 04
3
Returning the mock associated with an expectation.
I was reading through the FlexMock docs and noticed the expectation
method .mock, which returns the original mock associated with an
expectation.
It looks really handy for writing nice all-in-one mocks like:
mock_user = mock(''User'').expects(:first_name).returns(''Jonah'').mock
So I started playing around with mocha and found I could actually
already do this!
2012 Sep 16
0
tutorail test writing problem
Hello,
I try to follow this tutorial :
http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
Im now at chapter 3.2.1.
But the test is still failing even if I do everything according to the
chapter.
My code can be found here : https://github.com/roelof1967/demo_app
And the faiing message is :
Failures:
1) Static pages Home page should have the content ''Sample App''
2007 Sep 11
1
Can NOT overides the stub! in the setup
Hello,
I am new to rSpec. I tried to search in the list, but could not find
the answer, please forgive me if somebody already answered this. Here
is my question:
I have a stub in setup:
before(:each) do
@current_user = mock("devsu")
# Generally, prefer stub! over should_receive in setup.
User.stub!(:find).and_return(@current_user)
session[:user] = @current_user.id
2007 Dec 11
3
can''t access helper methods for model testing
I would like to have some valid mock models readily available in the
helper module, but when I try to access the helper I get the error
saying that the method is not found.
=======
describe MembersHelper do # Helper methods can be called directly in the
examples (it blocks)
def valid_member_mock
member = mock_model(Member)
member.stub!(:first_name).and_return("Joe")
2010 Sep 01
2
Undefined methods: has_selector? and flunk
I''m in the process of updating an app for Rails 3.0 and rspec-rails
2.0.0.beta20. When I''m running my specs (rake spec) I get a large number
of errors caused by two undefined methods
undefined method `has_selector?'' for #<String:0x7fdbd0b5b270>
undefined method `flunk'' for
2010 May 07
2
Rspec beta8: helper methods issues
Hello everybody,
I am experiencing the following problems, I googled quickly but I
couldn''t find any documentation or solution to those issues:
1) the generator rails g rspec:helper does nothing;
2) there seems to be no way to test helper methods as I used to do...
for example
the following spec
it ''should set monday as first day of the week'' do