Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
diaspora
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Milan
diaspora
Commits
8c92c313
Commit
8c92c313
authored
14 years ago
by
danielvincent
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of github.com:diaspora/diaspora
parents
0621aa2f
962f282c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/models/aspect.rb
+1
-0
1 addition, 0 deletions
app/models/aspect.rb
spec/models/aspect_spec.rb
+15
-0
15 additions, 0 deletions
spec/models/aspect_spec.rb
with
16 additions
and
0 deletions
app/models/aspect.rb
+
1
−
0
View file @
8c92c313
...
...
@@ -17,6 +17,7 @@ class Aspect
belongs_to
:user
,
:class_name
=>
'User'
validates_presence_of
:name
validates_uniqueness_of
:name
,
:scope
=>
:user_id
timestamps!
...
...
This diff is collapsed.
Click to expand it.
spec/models/aspect_spec.rb
+
15
−
0
View file @
8c92c313
...
...
@@ -39,6 +39,21 @@ describe Aspect do
end
end
describe
'validation'
do
before
do
@aspect
=
@user
.
aspect
(
:name
=>
'losers'
)
end
it
'has a unique name for one user'
do
aspect2
=
@user
.
aspect
(
:name
=>
@aspect
.
name
)
aspect2
.
valid?
.
should
be_false
end
it
'has no uniqueness between users'
do
aspect2
=
@user2
.
aspect
(
:name
=>
@aspect
.
name
)
aspect2
.
valid?
.
should
be_true
end
end
describe
'querying'
do
before
do
@aspect
=
@user
.
aspect
(
:name
=>
'losers'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment