Fixtures are scopes used for running tests which isolate each test from global namespace pollution and side-effects from previous tests in order to avoid false positives and false negatives
Questions tagged [fixtures]
1601 questions
0
votes
0 answers
Grails Fixtures Plugin: How do I purge a fixture after running one test case with it?
Let's say I have a fixture defined a:
def fixture = fixtureLoader.load {
book( Book, name: "XYZ")
}
I want to do something like:
fixture.purge()
Is it possible? If so, how?

Alexander Suraphel
- 10,103
- 10
- 55
- 90
0
votes
1 answer
Pytest: Carthesian product of dependent fixtures
Imagine the following testsuite
import pytest
@pytest.fixture(params=1, 2, 3)
def shape(request):
return request.param
@pytest.fixture
def data(shape):
return shape
def test_resize(data, shape):
pass
where I have two fixtures data…

Nils Werner
- 34,832
- 7
- 76
- 98
0
votes
1 answer
Rails 4: Error on collection through association in (TestCase) controller index action test
polls_controller.rb
def index
@polls = current_user.polls
end
Above works fine for my user (current_user) has_many polls association. I thought I could replicate this in tests by setting appropriate fixtures.
polls_controller_test.rb
…

Ben
- 197
- 3
- 11
0
votes
1 answer
Getting fixtures to load after creating a join table entity
I recently asked the following question:
Many to Many, One to Many or Many to One
After doing the updates suggested by @inanzzz my database looks great now however my fixtures seem to not work. I get the following error when trying to load…

Alex Foxleigh
- 1,784
- 2
- 21
- 47
0
votes
1 answer
Add fixtures with ember-cli 0.1.2
This is the same question as this one or this one, but it seems that the code generated by ember-cli has changed. This is my current system:
» ember --version
version: 0.1.2
node: 0.10.25
npm: 2.1.3
This is the full content of my book model file…

blueFast
- 41,341
- 63
- 198
- 344
0
votes
1 answer
How use the attributes of a fabricator within the definition of the fabricator?
I have a User and UserProfile models. Currently both models have the attributes first_name, last_name, and email and they must be the same. Later on I will remove these attributes from User but currently I want it that way. A UserProfile belongs_to…

Alexander Popov
- 23,073
- 19
- 91
- 130
0
votes
1 answer
How can I select the top result from an Ember fixture?
I've got the following data for a single stock across a range of dates which for the moment is an Ember fixture:
App.Stock.FIXTURES = [
{
id:1,
value:85.7,
date: '2014-01-01T00:00:00'
},
{
id:2,
…

tooba
- 551
- 5
- 22
0
votes
2 answers
Agile Web Development with Rails 4: MiniTest error for Update action in line_items_controller_test.rb
I'm a beginner working my way through Agile Web Development with Rails 4 where we (readers) build a shopping-cart style demo app. So, far the main REST resources are 1) products, 2) carts and 3) line items. This is my second demo/sample app on my…

Ben
- 197
- 3
- 11
0
votes
1 answer
Set up Sails 0.10.x fixtures with barrels, but none are in the database
Starting from this example (using Sails 0.9.x) from the Barrels author himself with slight modification based on in Barrels' repo (using Sails 0.10.x) and my project setup, here's my configuration:
/test/specHelper.js (which is the test…

Dida
- 941
- 1
- 9
- 22
0
votes
1 answer
How can I use Ember Data's FixtureAdapter with real API content
I want to populate my Ember Data fixtures with real content taken from an API data dump instead of the standard fixtures. I don't want to use the API directly.
I want to do this so I can imitate a local instance of the API data.
How can I…

Elise Chant
- 5,048
- 3
- 29
- 36
0
votes
1 answer
Auto jump in Box2d Collsion detection
i have auto player (Computer ) in my bike race game. whenever some hard objects is there like traffic light, road blocker, speed braker. it nee dto jump automatically.
For that , in poarticular object class am checking which fixture is colliding…

Helix
- 125
- 1
- 12
0
votes
1 answer
Saving common data for fixtures in Doctrine
What are the best-practice ways to keep the common data for the fixtures? Something like users. One entity contain id, another entity firstname and lastname, third entity another data related with user. Then number of users is growing up, number of…

Hayate
- 653
- 1
- 9
- 25
0
votes
1 answer
Possible way to create fixtures in the view with Django?
as the title says. Is there a possible way to create fixtures in the view with Django?
Thanks a lot!

user3357845
- 45
- 4
0
votes
1 answer
Error due to ArrayCollection in Entity when loading Doctrine Fixtures
I created a fixtures for two related entities. When trying to load the fixtures with
php app/console doctrine:fixtures:load
I always get this error:
Fatal error: Class '[MyNamespace]\Entity\ArrayCollection' not found in [...]
It references this…

matt_jay
- 1,241
- 1
- 15
- 33
0
votes
1 answer
Can't save the relation in a self-referencing entity
Im tying to add communication parts to a rootCommunication in my data-fixture, there is no error, but only just NULL in the database field 'root_communication_id'. Why?
Parts of my Model 'Communication'
/**
* Communication
*
*…

hlaranex
- 1