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
...
@@ -32,9 +32,7 @@ RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do
context
'with large tables'
do
context
'with large tables'
do
context
'when calling Issue.count'
do
context
'when calling Issue.count'
do
it
'register an offence'
do
it
'register an offence'
do
inspect_source
<<~
SRC
inspect_source
(
'Issue.count'
)
Issue.count
SRC
expect
(
cop
.
offenses
.
size
).
to
eq
(
1
)
expect
(
cop
.
offenses
.
size
).
to
eq
(
1
)
end
end
...
@@ -42,9 +40,7 @@ RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do
...
@@ -42,9 +40,7 @@ RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do
context
'when calling Issue.active.count'
do
context
'when calling Issue.active.count'
do
it
'register an offence'
do
it
'register an offence'
do
inspect_source
<<~
SRC
inspect_source
(
'Issue.active.count'
)
Issue.active.count
SRC
expect
(
cop
.
offenses
.
size
).
to
eq
(
1
)
expect
(
cop
.
offenses
.
size
).
to
eq
(
1
)
end
end
...
@@ -52,9 +48,7 @@ RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do
...
@@ -52,9 +48,7 @@ RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do
context
'when calling count(Issue)'
do
context
'when calling count(Issue)'
do
it
'does not register an offence'
do
it
'does not register an offence'
do
inspect_source
<<~
SRC
inspect_source
(
'count(Issue)'
)
count(Issue)
SRC
expect
(
cop
.
offenses
).
to
be_empty
expect
(
cop
.
offenses
).
to
be_empty
end
end
...
@@ -62,9 +56,7 @@ RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do
...
@@ -62,9 +56,7 @@ RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do
context
'when calling count(Ci::Build.active)'
do
context
'when calling count(Ci::Build.active)'
do
it
'does not register an offence'
do
it
'does not register an offence'
do
inspect_source
<<~
SRC
inspect_source
(
'count(Ci::Build.active)'
)
count(Ci::Build.active)
SRC
expect
(
cop
.
offenses
).
to
be_empty
expect
(
cop
.
offenses
).
to
be_empty
end
end
...
@@ -72,9 +64,7 @@ RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do
...
@@ -72,9 +64,7 @@ RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do
context
'when calling Ci::Build.active.count'
do
context
'when calling Ci::Build.active.count'
do
it
'register an offence'
do
it
'register an offence'
do
inspect_source
<<~
SRC
inspect_source
(
'Ci::Build.active.count'
)
Ci::Build.active.count
SRC
expect
(
cop
.
offenses
.
size
).
to
eq
(
1
)
expect
(
cop
.
offenses
.
size
).
to
eq
(
1
)
end
end
...
@@ -82,9 +72,7 @@ RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do
...
@@ -82,9 +72,7 @@ RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do
context
'when using allowed methods'
do
context
'when using allowed methods'
do
it
'does not register an offence'
do
it
'does not register an offence'
do
inspect_source
<<~
SRC
inspect_source
(
'Issue.minimum'
)
Issue.minimum
SRC
expect
(
cop
.
offenses
).
to
be_empty
expect
(
cop
.
offenses
).
to
be_empty
end
end
...
@@ -93,9 +81,7 @@ RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do
...
@@ -93,9 +81,7 @@ RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do
context
'with non related class'
do
context
'with non related class'
do
it
'does not register an offence'
do
it
'does not register an offence'
do
inspect_source
<<~
SRC
inspect_source
(
'Rails.count'
)
Rails.count
SRC
expect
(
cop
.
offenses
).
to
be_empty
expect
(
cop
.
offenses
).
to
be_empty
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