Skip to content

Commit

Permalink
Refactored so that our helper does not try to submit id based data to…
Browse files Browse the repository at this point in the history
… a field
  • Loading branch information
baphled committed Jul 22, 2010
1 parent 755d8e3 commit bf2478b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions features/support/env.rb
Expand Up @@ -85,9 +85,9 @@ def fill_form(form_name, opts = {})
def fill_in_form_with_duplicate_data form_name
model = form_name.capitalize.constantize.make
opts = model.attributes
['id', 'example_id', 'created_at', 'updated_at', 'path'].each do |param|
opts.delete param
end
unsubmitables = ['created_at', 'updated_at', 'path']
model.attributes.each { |key, attribute| unsubmitables << key if not key.match(/id$/).nil? }
unsubmitables.each { |param| opts.delete param }
fill_form form_name.singularize, opts
end
end
Expand Down

0 comments on commit bf2478b

Please sign in to comment.