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
1cffeca4
Commit
1cffeca4
authored
Sep 08, 2020
by
gaga5lala
Committed by
Thong Kuah
Sep 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert spec_helper to fast_spec_helper
parent
dd760dcb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
changelogs/unreleased/gaga5lala-issue-222306.yml
changelogs/unreleased/gaga5lala-issue-222306.yml
+5
-0
spec/rubocop/cop/migration/update_column_in_batches_spec.rb
spec/rubocop/cop/migration/update_column_in_batches_spec.rb
+9
-9
No files found.
changelogs/unreleased/gaga5lala-issue-222306.yml
0 → 100644
View file @
1cffeca4
---
title
:
Convert spec_helper to fast_spec_helper
merge_request
:
41755
author
:
gaga5lala
type
:
other
spec/rubocop/cop/migration/update_column_in_batches_spec.rb
View file @
1cffeca4
# frozen_string_literal: true
require
'spec_helper'
require
'
fast_
spec_helper'
require
'rubocop'
require
'rubocop/rspec/support'
require_relative
'../../../../rubocop/cop/migration/update_column_in_batches'
RSpec
.
describe
RuboCop
::
Cop
::
Migration
::
UpdateColumnInBatches
do
RSpec
.
describe
RuboCop
::
Cop
::
Migration
::
UpdateColumnInBatches
,
type: :rubocop
do
let
(
:cop
)
{
described_class
.
new
}
let
(
:tmp_rails_root
)
{
Rails
.
root
.
join
(
'tmp'
,
'rails_root'
)
}
let
(
:tmp_rails_root
)
{
rails_root_
join
(
'tmp'
,
'rails_root'
)
}
let
(
:migration_code
)
do
<<-
END
def up
...
...
@@ -27,7 +27,7 @@ RSpec.describe RuboCop::Cop::Migration::UpdateColumnInBatches do
FileUtils
.
rm_rf
(
tmp_rails_root
)
end
let
(
:spec_filepath
)
{
tmp_rails_root
.
join
(
'spec'
,
'migrations'
,
'my_super_migration_spec.rb'
)
}
let
(
:spec_filepath
)
{
File
.
join
(
tmp_rails_root
,
'spec'
,
'migrations'
,
'my_super_migration_spec.rb'
)
}
context
'outside of a migration'
do
it
'does not register any offenses'
do
...
...
@@ -83,31 +83,31 @@ RSpec.describe RuboCop::Cop::Migration::UpdateColumnInBatches do
end
context
'in a migration'
do
let
(
:migration_filepath
)
{
tmp_rails_root
.
join
(
'db'
,
'migrate'
,
'20121220064453_my_super_migration.rb'
)
}
let
(
:migration_filepath
)
{
File
.
join
(
tmp_rails_root
,
'db'
,
'migrate'
,
'20121220064453_my_super_migration.rb'
)
}
it_behaves_like
'a migration file with no spec file'
it_behaves_like
'a migration file with a spec file'
end
context
'in a post migration'
do
let
(
:migration_filepath
)
{
tmp_rails_root
.
join
(
'db'
,
'post_migrate'
,
'20121220064453_my_super_migration.rb'
)
}
let
(
:migration_filepath
)
{
File
.
join
(
tmp_rails_root
,
'db'
,
'post_migrate'
,
'20121220064453_my_super_migration.rb'
)
}
it_behaves_like
'a migration file with no spec file'
it_behaves_like
'a migration file with a spec file'
end
context
'EE migrations'
do
let
(
:spec_filepath
)
{
tmp_rails_root
.
join
(
'ee'
,
'spec'
,
'migrations'
,
'my_super_migration_spec.rb'
)
}
let
(
:spec_filepath
)
{
File
.
join
(
tmp_rails_root
,
'ee'
,
'spec'
,
'migrations'
,
'my_super_migration_spec.rb'
)
}
context
'in a migration'
do
let
(
:migration_filepath
)
{
tmp_rails_root
.
join
(
'ee'
,
'db'
,
'migrate'
,
'20121220064453_my_super_migration.rb'
)
}
let
(
:migration_filepath
)
{
File
.
join
(
tmp_rails_root
,
'ee'
,
'db'
,
'migrate'
,
'20121220064453_my_super_migration.rb'
)
}
it_behaves_like
'a migration file with no spec file'
it_behaves_like
'a migration file with a spec file'
end
context
'in a post migration'
do
let
(
:migration_filepath
)
{
tmp_rails_root
.
join
(
'ee'
,
'db'
,
'post_migrate'
,
'20121220064453_my_super_migration.rb'
)
}
let
(
:migration_filepath
)
{
File
.
join
(
tmp_rails_root
,
'ee'
,
'db'
,
'post_migrate'
,
'20121220064453_my_super_migration.rb'
)
}
it_behaves_like
'a migration file with no spec file'
it_behaves_like
'a migration file with a spec file'
...
...
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