Zach Dennis wrote:
XPath is merely the mechanism in which you're allowed to find
particular elements on a page. After typing:
xpath :input, :name = foo
xpath :input, :name = bar
xpath :input, :name = baz
I would probably write my own wrapper so I could omit the redundant
xpath call
Zach Dennis wrote:
response.body.should be_xml_with do
form :action = '/users' do
fieldset do
legend Personal Information
label First name
input :type = 'text', :name = 'user[first_name]'
end
end
end
I like this a lot.
Boom: http://gist.github.com/76136
it
On Mon, Mar 9, 2009 at 4:44 AM, karmacoma oliver.bedd...@googlemail.com wrote:
Hi,
I am in the process of upgrading my rails application to be compatible
with rails 2.2.2. All is going well apart from a few remaining issues.
My problem is: I am experiencing a test failure with what seems to
On Fri, Mar 6, 2009 at 1:27 PM, Tom Ten thij li...@ruby-forum.com wrote:
I'm afraid I can't give a release date. 0.2 is fixed(ish) scope, and
therefore time can't be fixed at the same time. I have a lot of travel
the next month, so it will take a least a month I'm afraid.
I know I for
Zach Dennis wrote:
In my experience relying on the syntactic details of the page is
extremely brittle and cumbersome. ... Some tags have both syntactic
and semantic meaning, such as forms, labels, fieldsets, and anchor tags.
Is it brittle to test for specific css selectors that are tied to
I must be missing something obvious here but I cannot seem to see it.
I have this step definition:
When /entity named (.*) has a legal name (.*)/ do |name, legal|
myentity = Entity.find_by_entity_common_name!(name.hll_keycase)
myentity.entity_legal_name.should equal legal.hll_keycase
end
Use should == instead of equal. == is equality, equal is object
identity. You very rarely want to use equal.
foo.equal? foo
= false
foo == foo
= true
Pat
On Mar 9, 2009, at 10:18 AM, James Byrne wrote:
I must be missing something obvious here but I cannot seem to see it.
I have this
On Mon, Mar 9, 2009 at 6:18 PM, James Byrne li...@ruby-forum.com wrote:
I must be missing something obvious here but I cannot seem to see it.
I have this step definition:
When /entity named (.*) has a legal name (.*)/ do |name, legal|
myentity =
At 10:54 -0700 3/9/09, Pat Maddox wrote:
Use should == instead of equal. == is equality, equal
is object identity. You very rarely want to use equal.
It's probably far too late to change this, but it might
have made more sense to define same_obj_as?() for the
object identity case, leaving
On Mon, Mar 9, 2009 at 2:32 PM, Rich Morin r...@cfcl.com wrote:
At 10:54 -0700 3/9/09, Pat Maddox wrote:
Use should == instead of equal. == is equality, equal
is object identity. You very rarely want to use equal.
It's probably far too late to change this, but it might
have made more sense
Pat Maddox wrote:
Use should == instead of equal. == is equality, equal is object
identity. You very rarely want to use equal.
foo.equal? foo
= false
foo == foo
= true
Pat
Thanks. Although, if I recall correctly then I am advised to use the
form
x.should be == y .
;-
--
To prevent duplicate values in the DBMS I use a unique index on those
columns. I am testing that duplicate values cannot, in fact, be added.
This is the cucumber scenario:
Scenario: The legal name must be unique
Given I do have a user named admin
And the user named admin is
James Byrne wrote:
Q.
To prevent duplicate values in the DBMS I use a unique index on those
columns. I am testing that duplicate values cannot, in fact, be added.
I thought, probably incorrectly, that when #save is called then any
errors are returned to the controller to handle. This is
James Byrne wrote:
Zach Dennis wrote:
In my experience relying on the syntactic details of the page is
extremely brittle and cumbersome. ... Some tags have both syntactic
and semantic meaning, such as forms, labels, fieldsets, and anchor tags.
Is it brittle to test for specific css
David Chelimsky wrote:
No, no, no :)
5.should == 5
6.should be 5
Read them aloud and they.should make(:sense).
Cheers,
David
Perhaps it is my dialect, but what is wrong with:
5 should be equal to 5
which generally is how I read ==? Actually, I tend to read == (in
Ruby) as is
ActiveRecord doesn't know anything about db constraint errors. If one
is violated, the error propagates up in the form of an exception.
Put a validates_uniqueness_of :login_name on your User class, and
you'll get the behavior you want. You can keep the db constraint in
as a safety net
Pat Maddox wrote:
ActiveRecord doesn't know anything about db constraint errors. If one
is violated, the error propagates up in the form of an exception.
I realize that, but the exception is of the
ActiveRecord:StatementInvalid class, which I should be able to catch in
the controller with
On Mar 9, 2009, at 4:53 PM, James Byrne wrote:
Pat Maddox wrote:
ActiveRecord doesn't know anything about db constraint errors. If
one
is violated, the error propagates up in the form of an exception.
I realize that, but the exception is of the
ActiveRecord:StatementInvalid class, which
On Mon, Mar 9, 2009 at 2:48 PM, James Byrne li...@ruby-forum.com wrote:
David Chelimsky wrote:
No, no, no :)
5.should == 5
6.should be 5
Read them aloud and they.should make(:sense).
Cheers,
David
Perhaps it is my dialect, but what is wrong with:
5 should be equal to 5
which
ActiveRecord doesn't know anything about db constraint errors. If
one
is violated, the error propagates up in the form of an exception.
I realize that, but the exception is of the
ActiveRecord:StatementInvalid class, which I should be able to catch
in
the controller with a rescue clause.
On Mon, Mar 9, 2009 at 12:08 PM, James Byrne li...@ruby-forum.com wrote:
Zach Dennis wrote:
In my experience relying on the syntactic details of the page is
extremely brittle and cumbersome. ... Some tags have both syntactic
and semantic meaning, such as forms, labels, fieldsets, and anchor
http://gist.github.com/76136
response.body.should be_html_with{
form :action = '/users' do
fieldset do
legend 'Personal Information'
label 'First name'
input :type = 'text', :name = 'user[first_name]'
end
end
}
Has anyone
On Mon, Mar 9, 2009 at 8:48 PM, James Byrne li...@ruby-forum.com wrote:
David Chelimsky wrote:
No, no, no :)
5.should == 5
6.should be 5
Read them aloud and they.should make(:sense).
Cheers,
David
Perhaps it is my dialect, but what is wrong with:
5 should be equal to 5
On Mon, Mar 9, 2009 at 6:20 PM, Phlip phlip2...@gmail.com wrote:
http://gist.github.com/76136
response.body.should be_html_with{
form :action = '/users' do
fieldset do
legend 'Personal Information'
label 'First name'
input :type = 'text', :name =
Has anyone tried this? is it useful?
It looks interesting, though it could be confused for trying to exactly
mimic the actual markup, not just specify interesting parts.
On Mon, Mar 9, 2009 at 7:20 PM, Phlip phlip2...@gmail.com wrote:
http://gist.github.com/76136
response.body.should
Tim Glen wrote:
Just a stab in the dark, but I haven't seen any mention of calling
save vs. save!. save just puts any errors in the model, save! will
raise the exception if there are any errors. That may not be the case
for ActiveRecord:StatementInvalid exception, but I thought i'd mention
On Mon, Mar 9, 2009 at 6:49 PM, Pat Nakajima patnakaj...@gmail.com wrote:
Has anyone tried this? is it useful?
It looks interesting, though it could be confused for trying to exactly
mimic the actual markup, not just specify interesting parts.
What is the method name was be_html_including
Just a stab in the dark, but I haven't seen any mention of calling
save vs. save!. save just puts any errors in the model, save! will
raise the exception if there are any errors. That may not be the case
for ActiveRecord:StatementInvalid exception, but I thought i'd
mention
it anyway.
I
Pat Nakajima wrote:
Has anyone tried this? is it useful?
It looks interesting, though it could be confused for trying to exactly
mimic the actual markup, not just specify interesting parts.
It only specifies interesting parts. The gist writeup explained that, for
example, it skipped
On Mar 9, 2009, at 1:53 PM, James Byrne wrote:
Pat Maddox wrote:
ActiveRecord doesn't know anything about db constraint errors. If
one
is violated, the error propagates up in the form of an exception.
I realize that, but the exception is of the
ActiveRecord:StatementInvalid class, which
I haven't tried it yet, but it does seem very useful. The project I'm
focused on right now is all json all the time, so I don't personally
have a real world case for this at the moment. Anybody doing an app w/
html views willing to try this out?
I put it into my current project today (as a
31 matches
Mail list logo