From 8937f088d18b338ed99fd2d05ec42be235cef58c Mon Sep 17 00:00:00 2001 From: Laust Rud Jacobsen Date: Sat, 31 Oct 2015 10:36:21 +0100 Subject: [PATCH] Fix current minor rubocop style warnings --- db/migrate/201510290041_extract_issue_tracker.rb | 23 +++++++++++------------ spec/views/problems/index.html.haml_spec.rb | 2 -- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/db/migrate/201510290041_extract_issue_tracker.rb b/db/migrate/201510290041_extract_issue_tracker.rb index 627e06a..4d2a74d 100644 --- a/db/migrate/201510290041_extract_issue_tracker.rb +++ b/db/migrate/201510290041_extract_issue_tracker.rb @@ -1,5 +1,4 @@ class ExtractIssueTracker < Mongoid::Migration - TRACKER_MAPPING = { 'ErrbitTracPlugin::IssueTracker' => 'trac', 'IssueTrackers::BitbucketIssuesTracker' => 'bitbucket', @@ -26,18 +25,18 @@ class ExtractIssueTracker < Mongoid::Migration updated_at = options.delete('updated_at') created_at = options.delete('created_at') - if TRACKER_MAPPING.include?(type) - tracker = { - 'type_tracker' => TRACKER_MAPPING[type], - 'options' => options, - 'updated_at' => updated_at, - 'created_at' => created_at - } + next unless TRACKER_MAPPING.include?(type) + + tracker = { + 'type_tracker' => TRACKER_MAPPING[type], + 'options' => options, + 'updated_at' => updated_at, + 'created_at' => created_at + } - App.where({ _id: app.id }).update({ - "$set" => { :issue_tracker => tracker } - }) - end + App.where({ _id: app.id }).update({ + "$set" => { :issue_tracker => tracker } + }) end end diff --git a/spec/views/problems/index.html.haml_spec.rb b/spec/views/problems/index.html.haml_spec.rb index f2c32e5..3a9d07c 100644 --- a/spec/views/problems/index.html.haml_spec.rb +++ b/spec/views/problems/index.html.haml_spec.rb @@ -22,7 +22,6 @@ describe "problems/index.html.haml", type: 'view' do end describe "show/hide resolved button behavior" do - it "displays unresolved errors title and button" do allow(view).to receive(:all_errs).and_return(false) render @@ -36,6 +35,5 @@ describe "problems/index.html.haml", type: 'view' do expect(view.content_for :title).to match 'All Errors' expect(view.content_for :action_bar).to have_link 'hide resolved' end - end end -- libgit2 0.21.2