Oscar Del ben wrote:
> David Chelimsky wrote:
>> It's definitely happening. We've enlisted a few additional
>> contributors and the wheels are spinning faster now.
>>
>> As for the beta book, I don't know if there will be on at this point.
>> We may go straight to print. Either way, I'll update as
autotest will no longer run my tests after I installed the rpsec gem and
removed the plugins. I did install the rspec-rails gem as well.
Is anyone else having this issue?
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users
I see that in 1.1.5 you are no longer supposed to use autotest. Things
are now working using autospec.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Chris Olsen wrote:
> I see that in 1.1.5 you are no longer supposed to use autotest. Things
> are now working using autospec.
I now noticed that what you mentioned in your reply. I totally missed
that point.
Thanks again David.
--
Posted via http://www.ruby-for
David Chelimsky wrote:
> On Sat, Nov 1, 2008 at 3:25 PM, Chris Olsen <[EMAIL PROTECTED]>
> wrote:
>> autotest will no longer run my tests after I installed the rpsec gem and
>> removed the plugins. I did install the rspec-rails gem as well.
>>
>> Is anyone e
I am getting the error when I run the command: rake spec
This is a new project with not current test written besides the ones
auto-created for me.
+
$ rake spec
(in /Users/chrisolsen/Projects/Rails/chrisolsen/trunk)
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/
That was the problem. I didn't even occur to me that it was looking for
that helper class.
Thanks for the help.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspe
Just created a new project and this is the error that I am getting when
I try to run my rspec tests:
Spec::Rails::DSL::HelperEvalContextController: missing default helper
path spec/rails/dsl/helper_eval_context_helper
Spec::Rails::DSL::ViewExampleController: missing default helper path
spec/rails/
> Please just call them "specs" :)
done
> What command are you using here?
it happens for both "rake spec" and autotest
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/lis
For some reason when I ran it this time it decided not to create any
view or controller tests. I had already created the corresponding model
with the rpsec_model script before trying to create the controller. I
am not sure if there is something that I did incorrectly or not.
Does anyone know why
please disregard this post. I got a little a head of myself and forgot
that they were only created with the rspec_scaffold script.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/ma
Steve wrote:
> On Tue, 16 Oct 2007 04:44:55 +0200, Chris Olsen wrote:
>
>> For some reason when I ran it this time it decided not to create any
>> view or controller tests. I had already created the corresponding model
>> with the rpsec_model script before trying to c
I am a little confused to the what happens with the following:
before do
@site = mock_model(Site, :to_param => "1")
Site.stub!(:new).and_return(@site)
end
def post_with_successful_save
@site.should_receive(:save).and_return(true)
post :create, :site => {}
end
I understand
That is what I thought (and was hoping for)
Thanks David.
> This is a bit tricky. What you're setting up here (which is true of
> message expectations in general, not must mock_model) is an
> expectation that @site will receive the message :save and that when it
> does receive it, you are instru
I would like to remove some unused helpers from the app/helpers dir, but
when I do so my specs fail.
Why is this? I don't see where those helpers are referenced within the
tests. Is there a way to delete these unused files?
Thanks
--
Posted via http://www.ruby-forum.com/.
__
> A stacktrace would help
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -S
script/spec -O spec/spec.opts spec/views/addresses/show.rhtml_spec.rb
spec/helpers/addresses_helper_spec.rb
spec/views/addresses/index.rhtml_spec.rb
spec/views/addresses/edit.rhtml_spec.rb
spec
Hans de Graaff wrote:
> Looks like you still have a (possibly generated?) spec for this helper.
>
> Kind regards,
>
> Hans
I do, but the issue is that it requires the
app/helpers/addresses_helper.rb file, which is that one that I am trying
to delete.
`load_missing_constant': Expected
/Users/c
I can't figure out why I am getting a failure. It renders out fine in
the browser.
New member
<%= error_messages_for :member %>
<% form_for(:member, :url => members_path) do |f| %>
Member Info
First Name: <%=
f.text_field :first_name %>
Last Name: <%=
f.text_field :last_name %
Thanks for the help David.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
I have an address model with country_id and province_id fields
There is also a full_address method that returns an address that is in a
format that the google maps api will be able to return a long-lat
coords.
Within the full_address method there is a call to obtain the
province/state and country
That is the problem, which is clear now that I tested it with the
script/console in test mode rather than development.
So now the question is, why does the data not exist in the test
database. The country and province data inserts exist within the
migration files, ex for countries:
class Crea
Chris Olsen wrote:
> That is the problem, which is clear now that I tested it with the
> script/console in test mode rather than development.
>
> So now the question is, why does the data not exist in the test
> database. The country and province data inserts exist within t
That would make sense.
Thanks for the help.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
I am not sure why the tests don't see the call of the new method for the
Address class. It can be seen in the controller method where the
Address.new is called.
>> @address = Address.new(params[:address])
What am I doing wrong?
Thanks for the help.
Here is the error message:
Spec::Mocks::MockEx
Steve Ross wrote:
> Try with(nil)
>
> I think params[:user] will return nil.
yip that works, after fooling with it I also found that :any_args works
as well as any (I guess this one is more than just a symbol)
Thanks for the help.
--
Posted via http://www.ruby-forum.com/.
Testing models is great and would not be able to create anything without
it, but I am finding testing the controllers and views is a pain.
Rest based controllers don't seem to change that much when compared to
the auto-generated code that obviously works.
As for views I fail to see why testing it
Thanks for the info.
@Ben
I like the top down approach that you mentioned. It definitely makes
more sense to why I would test the views and how it will better define
the model parameters.
@Scott
I think that I am currently on the same page as you. Right now I don't
use a mock model in my cre
I can't figure out how to make the updates to allow for the route_form
method to return a url that matches the expected.
Here is a sample
route_for(:controller => :task, :action => :new).should == "/task/new"
If a task has to be created for a user, how exactly do I do this. The
following doesn't
Thanks Scott.
And of course after you tell me, I now see it sitting on the rspec
documentation page ever so elegantly.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listi
When do these files, along with lib/spec and lib/spec_server get
created?
I tried to create a quick test project and can't remember how they were
created in a previous project.
Thanks
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing li
Is anyone else getting this message?
With rails 2.0 pre-releases it looks like you also have to be working
with the latest version of rpsec.
$ ruby script/plugin install
svn://rubyforge.org/var/svn/rspec/trunk/rspec
svn: Connection closed unexpectedly
The above is what I get when I try to instal
David Chelimsky wrote:
>
> Try:
>
> http://rspec.rubyforge.org/svn/trunk/rspec
> http://rspec.rubyforge.org/svn/trunk/rspec_on_rails
That worked much better.
Thanks
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@r
When you guys test views, what are you testing? Do you just test that
all the form fields exist in a new.rhtml, that all form fields are
filled in an edit.rhtml, and that all the proper columns are are shown
in a index.rhtml page, or is there something more that should be tested?
Thanks.
--
Poste
This isn't the best example, as I normally wouldn't validate a mock
model, it was more for demonstration, although a bad one.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/l
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
>> What am I missing? Are these helpers only for controller tests?
>
> Rails helpers are there for views and controllers, not for models.
>
> If you want an RSpec helper, something you use to set up state for
> your examples, you can write a module and include it in the example
> groups - but t
Ya, just ignore this post, except for the question regarding the rpsec
book.
I really do wish there was a way to delete your own posts :)
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge
Here is the code within the controller:
Line 69: @photo = @member.build_photo(params[:photo]) unless
params[:photo][:uploaded_data].blank?
I got a little ahead of myself and wrote the code, and now have a bunch
of errors telling me that:
---
6)
NoMethodError in 'Spec::Rails::Example::Control
How does a person test private methods?
Is there a way to declare them as private, but retain any tests that
were written during the initial development?
Thanks.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyfor
Will obj.send(:method) work in 1.9 or is it saying that the send call
requires 2 params, the method and the object reference?
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman
In a create controller method I am testing the else clause that occurs
when the model is unable to be saved. Sounds simple enough, but because
model is created before the save and the form has to be re-filled I now
have to stub a model and all the attributes. Since the error messages
are displaye
Good point. I guess it was the account.user, account.users.build and
all the validation methods that I thought may be unnecessary.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/ma
I had an error that I couldn't figure out, then when writing up a
question for the forum I figured it out. The thing is I don't
understand why the change that was made works and why what existed
before didn't.
Here is the initial post when I had the error:
--
In th
Hey Ben,
That makes perfect sense. Thanks for pointing out the error because I
don't think I would've been able to figure it out.
Thanks, as well, for the stubbing/mocking tip. I will keep my eyes open
for that in the future.
--
Posted via http://www.ruby-forum.com/.
Just out of curiosity, why is that the following .should calls have to
differ to work?
The first is a normal check on the if the user is redirected if not
logged in
=
it "should redirect the user to the login screen" do
do_get
response.should redirect_to(new_session_url)
end
The
> Because the response object doesn't exist before the 'get'.
That makes things clearer. There have been a couple times that I have
put the response.should call before the do_get based on the reason you
mentioned, in setting up a stub before the call to the method is made.
Then after getting
I can't figure out why I am getting an error for one of the tests below:
describe AccountsController, "POST" do
before :each do
@user = mock_model(User)
@account = mock_model(Account, :id => 1, :valid => true, :save =>
true, :users => mock("users", :build => @user
Ooops there was a typo on the method causing the error. It should be:
It is this test that fails
it "should make the relation to the users" do
@account.should_receive(:users) # removed the .and_return
do_post
end
Is there a better way to test that the data is being loaded into the
related
I would like to delete most of the view helper files from my project.
Unfortunately, when I try to run my tests it throws an error saying that
one of the files is missing.
I find that all the non-required helper files clutter things up. Is
there any way to remove them and still have your tests pa
Scott Taylor wrote:
> On Apr 7, 2008, at 9:34 AM, Chris Olsen wrote:
>
>> I would like to delete most of the view helper files from my project.
>> Unfortunately, when I try to run my tests it throws an error saying
>> that
>> one of the files is missing.
&
Does Rspec work nicely with Haml for controller integrated view tests?
I am getting the following error:
===
ActionView::TemplateError in 'Admin::ListingsController index should get
a 200 OK'
undefined method `photo' for true:TrueClass
On line #2 of admin/listings/_listing.html.ham
I wanted to test that the links below were being rendered in the views.
- content_for :sidebar do
%ul.links
%li= edit_link edit_admin_contact_url(@contact), "Contact"
# view test
it "should have the correct side bar links" do
do_render
response.should have_tag("ul.links") d
Bryan Ray wrote:
> This might be of some use:
>
> http://rubyforge.org/pipermail/rspec-users/2007-June/001954.html
>
That should do it!
Thanks Bryan
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http
It is a nuisance to have to rename all of your files from .erb to .haml.
Is there a quick way around this?
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Thanks for letting me know. A ticket has been created.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
55 matches
Mail list logo