Project

General

Profile

Bug #13272

Basic edit test can fail when fixtures don't exist for a particular model

Added by Stephen Benjamin almost 4 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Category:
Tests
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Some helper methods now exist for testing edit pages:
test/functional/shared/basic_rest_response_test.rb

basic_edit_test takes a record as an argument, which for most models is passed as `ModelClass.first`, however, .first may not exist at class evaluation if there's no fixtures. This is the case with Usergroups.

And due to database cleaning, the object needs to be created within the context of the basic_edit_test method, so passing something like FactoryGirl.create directly also doesn't work in some cases.


Related issues

Related to Foreman - Refactor #11618: Replace validation tests by shoulda-matchersClosed2015-08-31

Associated revisions

Revision fa383aa2 (diff)
Added by Stephen Benjamin almost 4 years ago

fixes #13272 - use instance variable for basic_edit_test test helper

History

#1 Updated by The Foreman Bot almost 4 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3092 added

#2 Updated by Anonymous almost 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#3 Updated by Dominic Cleal almost 4 years ago

  • Related to Refactor #11618: Replace validation tests by shoulda-matchers added

#4 Updated by Dominic Cleal almost 4 years ago

  • Legacy Backlogs Release (now unused) set to 71

Also available in: Atom PDF