Skip to content

Support Capybara's :from option for selects #183

Closed
wants to merge 1 commit into from

5 participants

@dennisreimann

Use lookup via get_base_dom_id_from_label_tag only in case the fields name is not provided explicitly.

@dbloete dbloete Support Capybara's :from option for selects
Use lookup via get_base_dom_id_from_label_tag only in case the fields name is not provided explicitly.
9875c3f
@mattwynne
Cucumber member

Could you add a test for this please? A feature or preferably a (nice fast) spec.

@dennisreimann

Yeah, I'll do once I figure out how to setup specs. Right now there is only a spec for the generator and I struggled with requiring the right things and always ended up with "undefined method `World' for main:Object" when requiring 'cucumber/rails/capybara/select_dates_and_times'. Do you have any pointers for that or can you help setup a proper spec_helper.rb ?

@mattwynne
Cucumber member

Thanks!

It'll be because of https://github.com/dbloete/cucumber-rails/blob/master/lib/cucumber/rails/capybara/select_dates_and_times.rb#L45

You could probably just re-define that method in the spec before you require the file being tested.

@aslakhellesoy
Cucumber member

LGTM

@Kosmas
Cucumber member
Kosmas commented Mar 4, 2013

Patch fails with following error:

error: patch failed: lib/cucumber/rails/capybara/select_dates_and_times.rb:7
error: lib/cucumber/rails/capybara/select_dates_and_times.rb: patch does not apply
Patch failed at 0001 Support Capybara's :from option for selects Use lookup via get_base_dom_id_from_label_tag only in case the fields name is not provided explicitly.

@Kosmas
Cucumber member
Kosmas commented on 9875c3f Mar 5, 2013

Isn't that already included in current version?

in this patch we have:
base_dom_id = options[:from] || get_base_dom_id_from_label_tag(field)
base_dom_id = options[:from] || get_base_dom_id_from_label_tag(field)

and in the current version we have:
base_dom_id = get_base_dom_id_from_label_tag(options[:from])
base_dom_id = get_base_dom_id_from_label_tag(options[:from])

@Kosmas
Cucumber member
Kosmas commented Mar 9, 2013

Closing as I believe current version co

@Kosmas Kosmas closed this Mar 9, 2013
@Kosmas
Cucumber member
Kosmas commented Mar 9, 2013

Closing as I believe that current version covers that.
See comment above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.