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
a595f894
Commit
a595f894
authored
Sep 06, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1392 from NARKOZ/refactoring
refactor factory specs
parents
b299385e
46b9aafc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
87 deletions
+5
-87
app/assets/javascripts/projects.js.coffee
app/assets/javascripts/projects.js.coffee
+1
-1
spec/factories_spec.rb
spec/factories_spec.rb
+4
-86
No files found.
app/assets/javascripts/projects.js.coffee
View file @
a595f894
window
.
Projects
=
->
$
(
'#project_name'
).
on
'change'
,
->
slug
=
slugify
$
(
@
).
val
()
$
(
'#project_code'
).
val
slug
$
(
'#project_code
, #project_path
'
).
val
slug
$
(
'.new_project, .edit_project'
).
on
'ajax:before'
,
->
$
(
'.project_new_holder, .project_edit_holder'
).
hide
()
...
...
spec/factories_spec.rb
View file @
a595f894
require
'spec_helper'
describe
"Factories"
do
describe
'User'
do
it
"builds a valid instance"
do
build
(
:user
).
should
be_valid
end
it
"builds a valid admin instance"
do
build
(
:admin
).
should
be_valid
end
end
describe
'Project'
do
it
"builds a valid instance"
do
build
(
:project
).
should
be_valid
end
end
describe
'Issue'
do
it
"builds a valid instance"
do
build
(
:issue
).
should
be_valid
end
it
"builds a valid closed instance"
do
build
(
:closed_issue
).
should
be_valid
end
end
describe
'MergeRequest'
do
it
"builds a valid instance"
do
build
(
:merge_request
).
should
be_valid
end
end
describe
'Note'
do
it
"builds a valid instance"
do
build
(
:note
).
should
be_valid
end
end
describe
'Event'
do
it
"builds a valid instance"
do
build
(
:event
).
should
be_valid
end
end
describe
'Key'
do
it
"builds a valid instance"
do
build
(
:key
).
should
be_valid
end
it
"builds a valid deploy key instance"
do
build
(
:deploy_key
).
should
be_valid
end
it
"builds a valid personal key instance"
do
build
(
:personal_key
).
should
be_valid
end
end
describe
'Milestone'
do
it
"builds a valid instance"
do
build
(
:milestone
).
should
be_valid
end
end
describe
'SystemHook'
do
it
"builds a valid instance"
do
build
(
:system_hook
).
should
be_valid
end
end
describe
'ProjectHook'
do
it
"builds a valid instance"
do
build
(
:project_hook
).
should
be_valid
end
end
describe
'Wiki'
do
it
"builds a valid instance"
do
build
(
:wiki
).
should
be_valid
end
end
describe
'Snippet'
do
it
"builds a valid instance"
do
build
(
:snippet
).
should
be_valid
FactoryGirl
.
factories
.
map
(
&
:name
).
each
do
|
factory_name
|
describe
"
#{
factory_name
}
factory"
do
it
'should be valid'
do
build
(
factory_name
).
should
be_valid
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