Project

General

Profile

Actions

Bug #13272

closed

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

Added by Stephen Benjamin over 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Tests
Target version:
Difficulty:
Triaged:
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 1 (0 open1 closed)

Related to Foreman - Refactor #11618: Replace validation tests by shoulda-matchersClosedDaniel Lobato Garcia08/31/2015Actions
Actions #1

Updated by The Foreman Bot over 8 years ago

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

Updated by Anonymous over 8 years ago

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

Updated by Dominic Cleal over 8 years ago

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

Updated by Dominic Cleal over 8 years ago

  • translation missing: en.field_release set to 71
Actions

Also available in: Atom PDF