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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
acc32dab
Commit
acc32dab
authored
Oct 07, 2019
by
allison.browne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add scope tests to ZoomMeeting model
parent
01285cf8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
db/schema.rb
db/schema.rb
+2
-2
spec/models/zoom_meeting_spec.rb
spec/models/zoom_meeting_spec.rb
+21
-0
No files found.
db/schema.rb
View file @
acc32dab
...
...
@@ -3175,8 +3175,8 @@ ActiveRecord::Schema.define(version: 2019_10_04_133612) do
t
.
string
"tag"
t
.
text
"description"
t
.
integer
"project_id"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
text
"description_html"
t
.
integer
"cached_markdown_version"
t
.
integer
"author_id"
...
...
spec/models/zoom_meeting_spec.rb
View file @
acc32dab
...
...
@@ -16,6 +16,27 @@ describe ZoomMeeting do
it
{
is_expected
.
to
belong_to
(
:issue
).
required
}
end
describe
'scopes'
do
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let!
(
:added_meeting
)
{
create
(
:zoom_meeting
,
:added_to_issue
,
issue:
issue
)
}
let!
(
:removed_meeting
)
{
create
(
:zoom_meeting
,
:removed_from_issue
,
issue:
issue
)
}
describe
'.added_to_issue'
do
it
'gets only added meetings'
do
meetings_added
=
ZoomMeeting
.
added_to_issue
.
pluck
(
:id
)
expect
(
meetings_added
).
to
include
(
added_meeting
.
id
)
expect
(
meetings_added
).
not_to
include
(
removed_meeting
.
id
)
end
end
describe
'.removed_from_issue'
do
it
'gets only removed meetings'
do
meetings_removed
=
ZoomMeeting
.
removed_from_issue
.
pluck
(
:id
)
expect
(
meetings_removed
).
to
include
(
removed_meeting
.
id
)
expect
(
meetings_removed
).
to_not
include
(
added_meeting
.
id
)
end
end
end
describe
'Validations'
do
describe
'url'
do
it
{
is_expected
.
to
validate_presence_of
(
:url
)
}
...
...
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