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
db630c53
Commit
db630c53
authored
Jul 24, 2020
by
alinamihaila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use string for source
parent
dc42bddc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
21 deletions
+7
-21
spec/rubocop/cop/usage_data/large_table_spec.rb
spec/rubocop/cop/usage_data/large_table_spec.rb
+7
-21
No files found.
spec/rubocop/cop/usage_data/large_table_spec.rb
View file @
db630c53
...
...
@@ -32,9 +32,7 @@ RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do
context
'with large tables'
do
context
'when calling Issue.count'
do
it
'register an offence'
do
inspect_source
<<~
SRC
Issue.count
SRC
inspect_source
(
'Issue.count'
)
expect
(
cop
.
offenses
.
size
).
to
eq
(
1
)
end
...
...
@@ -42,9 +40,7 @@ RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do
context
'when calling Issue.active.count'
do
it
'register an offence'
do
inspect_source
<<~
SRC
Issue.active.count
SRC
inspect_source
(
'Issue.active.count'
)
expect
(
cop
.
offenses
.
size
).
to
eq
(
1
)
end
...
...
@@ -52,9 +48,7 @@ RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do
context
'when calling count(Issue)'
do
it
'does not register an offence'
do
inspect_source
<<~
SRC
count(Issue)
SRC
inspect_source
(
'count(Issue)'
)
expect
(
cop
.
offenses
).
to
be_empty
end
...
...
@@ -62,9 +56,7 @@ RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do
context
'when calling count(Ci::Build.active)'
do
it
'does not register an offence'
do
inspect_source
<<~
SRC
count(Ci::Build.active)
SRC
inspect_source
(
'count(Ci::Build.active)'
)
expect
(
cop
.
offenses
).
to
be_empty
end
...
...
@@ -72,9 +64,7 @@ RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do
context
'when calling Ci::Build.active.count'
do
it
'register an offence'
do
inspect_source
<<~
SRC
Ci::Build.active.count
SRC
inspect_source
(
'Ci::Build.active.count'
)
expect
(
cop
.
offenses
.
size
).
to
eq
(
1
)
end
...
...
@@ -82,9 +72,7 @@ RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do
context
'when using allowed methods'
do
it
'does not register an offence'
do
inspect_source
<<~
SRC
Issue.minimum
SRC
inspect_source
(
'Issue.minimum'
)
expect
(
cop
.
offenses
).
to
be_empty
end
...
...
@@ -93,9 +81,7 @@ RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do
context
'with non related class'
do
it
'does not register an offence'
do
inspect_source
<<~
SRC
Rails.count
SRC
inspect_source
(
'Rails.count'
)
expect
(
cop
.
offenses
).
to
be_empty
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