Hi -- if my controller action already ensures that the correct template is
being rendered, what use is speccing that it should also be successful?
I do it, but just because I saw someone else do it ages ago.
Is there a point?
Cheers,
Doug.
___
rspec-us
Hello Mike,
Thank you for your hint. Obviously, it worked!
Laughing at myself now: how post method was supposed to know what I
mean by :viewtype if don't specify it :)
Best,
Evgeny
On Jun 4, 10:14 pm, Mike Sassak wrote:
> Hi Evgeny,
>
> You didn't include the error message in your email, so thi
On 5 Jun 2009, at 13:36, doug livesey wrote:
Hi -- if my controller action already ensures that the correct
template is being rendered, what use is speccing that it should also
be successful?
I do it, but just because I saw someone else do it ages ago.
Is there a point?
It checks that the
So I am working on a project right now where we are combining Selenium and
RSpec. It was working really well until we implemented the grid and started
to do parallel execution on the specs to help speed things up. We are
rolling are own framework as DeepTest did not really provide the facilities
w
On Fri, Jun 5, 2009 at 9:44 AM, Joe Ocampo wrote:
> So I am working on a project right now where we are combining Selenium and
> RSpec. It was working really well until we implemented the grid and started
> to do parallel execution on the specs to help speed things up. We are
> rolling are own fr
Thanks David!
I will be sure to let you know our progress.
Joe Ocampo
agilejoe.lostechies.com
On Fri, Jun 5, 2009 at 10:07 AM, David Chelimsky wrote:
> On Fri, Jun 5, 2009 at 9:44 AM, Joe Ocampo wrote:
> > So I am working on a project right now where we are combining Selenium
> and
> > RSpec.
I am driving out a view and I want to test that a link is displayed.
The link_to code for the link is included in the layout for the view
rather than the view template itself.
Here's my example:
it "should display a link to create a new zone" do
render "contexts/index.html.erb", :layout =>
I am driving out a view that renders a list of items with which a
logged in member is associated.
Against each item, one or more links may be rendered according to the
member's role with respect to the item (item owner, item
administrator, regular user etc). Each link represents a type of
function
On Fri, Jun 5, 2009 at 11:54 AM, Lee wrote:
>
> When specifying the view, should I include examples to specify which
> links should appear against an item for each potential role of a
> member? Or is this going too far?
It depends. If you're doing full BDD on your view, using RSpec as a
design to
On Fri, Jun 5, 2009 at 11:40 AM, Lee wrote:
>
> Firstly, my experiments suggest that the layout is only rendered if
> the :layout attribute is included in the call to render. Is my
> understanding correct?
Yes, and it's the way things should be. I suggest writing a separate
spec for the layout, a
On Fri, Jun 5, 2009 at 11:54 AM, Lee wrote:
> I am driving out a view that renders a list of items with which a
> logged in member is associated.
>
> Against each item, one or more links may be rendered according to the
> member's role with respect to the item (item owner, item
> administrator, reg
> It's useful when you're doing TDD as it's the simplest thing to expect
> a controller to do. If you break something it's also quite a nice
> first-failure to have.
Hmm, I'm not sure about that. If the view fails to render, then Rails
returns the error page,
i.e: response.should be_success is tot
Damn I can't mock will_paginate's paginate method either!!!
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
I never spec my views. I also never put conditional logic in the views. If
you have links that should show up sometimes and not others why not just
move that logic into a helper or other associated class and test the method?
On Fri, Jun 5, 2009 at 10:04 AM, Zach Dennis wrote:
> On Fri, Jun 5,
Hello guys,
I've been looking at Pyccuracy and found the "Given/Then/When" blocks
to be very interesting and easier to understand and write, specially
when writting scenarios with more than one of those. An example can be
found here: http://www.pyccuracy.org/getting_started_3.html
Here's how they
Maurício Linhares wrote:
Hello guys,
I've been looking at Pyccuracy and found the "Given/Then/When" blocks
to be very interesting and easier to understand and write, specially
when writting scenarios with more than one of those. An example can be
found here: http://www.pyccuracy.org/getting_star
Hi, I cannot manage to mock a call to find_by_sql. Which class is
actually getting called? It is not the model, and I tried ActiveRecord
which didn't work either.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforg
Maurício Linhares wrote:
Hello guys,
I've been looking at Pyccuracy and found the "Given/Then/When" blocks
to be very interesting and easier to understand and write, specially
when writting scenarios with more than one of those. An example can be
found here: http://www.pyccuracy.org/getting_star
On Fri, Jun 5, 2009 at 3:33 PM, Fernando Perez wrote:
> Damn I can't mock will_paginate's paginate method either!!!
Same deal as your other post about find_by_sql. Set the message
expectation on the method on the class:
Post.should_receive(:paginate)
> --
> Posted via http://www.ruby-forum.com/
On Fri, Jun 5, 2009 at 3:29 PM, Fernando Perez wrote:
> Hi, I cannot manage to mock a call to find_by_sql. Which class is
> actually getting called? It is not the model, and I tried ActiveRecord
> which didn't work either.
It's the model's class:
class Foo < AR::Base; end
describe Foo do
it "
Maurício Linhares wrote:
Hello guys,
I've been looking at Pyccuracy and found the "Given/Then/When" blocks
to be very interesting and easier to understand and write, specially
when writting scenarios with more than one of those. An example can be
found here: http://www.pyccuracy.org/getting_star
I have a simple controller:
class AccessController < ApplicationController
def login
if request.post?
employee = Employee.authenticate(params[:name], params[:password])
if employee
session[:employee_id] = employee.id
redirect_to(:controller => "timesheets
On Fri, Jun 5, 2009 at 4:53 PM, Charlie Bowman wrote:
> I never spec my views. I also never put conditional logic in the views. If
> you have links that should show up sometimes and not others why not just
> move that logic into a helper or other associated class and test the method?
Good point.
The method I posted last week only works for Cucumber prior to 0.2.3.2.
For 0.2.3.2 and later, you cannot pass a block to the World more than
once, and thus the new way would be (in env.rb):
module FixtureAccess
def self.included(base)
(class << base; self; end).class_eval do
@@fixt
jruby-1.3.0
rspec/rspec-rails 1.2.6
I just ran into the 'Missing template' thing from the ticket below as
well. Is it really that uncommon for a controller action to redirect
or explicitly render a different template? Is it still considered
'invalid'? Seems silly to have to create a bunch o
This still wasn't fully working; I posted too soon. See here for the
final and working version:
http://wiki.github.com/aslakhellesoy/cucumber/fixtures
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
htt
I do this:
Fixtures.reset_cache
fixtures_folder = File.join(RAILS_ROOT, 'test', 'fixtures')
fixtures = Dir[File.join(fixtures_folder, '*.yml')].map {|f|
File.basename(f, '.yml') }
fixture_class_names = {} # or whatever needed
Fixtures.create_fixtures(fixtures_folder, fixtures, fixture_class_names)
On Fri, Jun 5, 2009 at 3:10 PM, Wayne Andersen wrote:
> I have a simple controller:
>
> class AccessController < ApplicationController
> def login
> if request.post?
> employee = Employee.authenticate(params[:name], params[:password])
> if employee
> session[:employee_id]
On Thu, Jun 4, 2009 at 8:41 PM, Charlie Bowman wrote:
> I have a helper method that does a "render :partial". The method works fine
> within the app (Rails 2.3.2). In rspec (1.2.6) I get an error ("Missing
> template /comments/_comment.erb in view path"
> It seems that rspec when running helper
On Fri, Jun 5, 2009 at 5:10 PM, Lenny Marks wrote:
> jruby-1.3.0
> rspec/rspec-rails 1.2.6
>
> I just ran into the 'Missing template' thing from the ticket below as well.
> Is it really that uncommon for a controller action to redirect or explicitly
> render a different template? Is it still consi
Thanks Steve.
As suggested I started to wrtite a separate spec for the layout:
require File.expand_path(File.dirname(__FILE__) + '/../../
spec_helper')
describe "layouts/contexts.html.erb" do
it "should display a link to create a new zone" do
render "layouts/contexts.html.erb"
end
end
Thank you everyone for your helpful insights.
I had already gone down the route suggested by Zach but it was
nevertheless very re-assuring to have my approach validated as I am a
newbie to RSpec. I did however consolidate my expectations e.g.:
context "when the member is a privileged member of
32 matches
Mail list logo