Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
d08de5ed
Commit
d08de5ed
authored
Mar 29, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for not Active Record based factories
parent
f2674c7b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
spec/factories_spec.rb
spec/factories_spec.rb
+12
-4
No files found.
spec/factories_spec.rb
View file @
d08de5ed
require
'spec_helper'
FactoryGirl
.
factories
.
map
(
&
:name
).
each
do
|
factory_name
|
describe
"
#{
factory_name
}
factory"
do
it
'should be valid'
do
expect
(
build
(
factory_name
)).
to
be_valid
describe
'factories'
do
FactoryGirl
.
factories
.
each
do
|
factory
|
describe
"
#{
factory
.
name
}
factory"
do
let
(
:entity
)
{
build
(
factory
.
name
)
}
it
'does not raise error when created '
do
expect
{
entity
}.
to_not
raise_error
end
it
'should be valid'
,
if:
factory
.
build_class
<
ActiveRecord
::
Base
do
expect
(
entity
).
to
be_valid
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment