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 almost 9 years ago. Updated over 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

Also available in: Atom PDF