From 62d7990b9bb30cf33ed87017c5c633d1cccc75c2 Mon Sep 17 00:00:00 2001 From: Toon Claes Date: Thu, 28 Feb 2019 19:57:34 +0100 Subject: Ran standardrb --fix on the whole codebase Inspired by https://twitter.com/searls/status/1101137953743613952 I decided to try https://github.com/testdouble/standard on our codebase. It's opinionated, but at least it's a _standard_. --- spec/helpers/namespaces_helper_spec.rb | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'spec/helpers/namespaces_helper_spec.rb') diff --git a/spec/helpers/namespaces_helper_spec.rb b/spec/helpers/namespaces_helper_spec.rb index 7ccbdcd1332..a1d91363165 100644 --- a/spec/helpers/namespaces_helper_spec.rb +++ b/spec/helpers/namespaces_helper_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' +require "spec_helper" describe NamespacesHelper do let!(:admin) { create(:admin) } @@ -11,8 +11,8 @@ describe NamespacesHelper do user_group.add_owner(user) end - describe '#namespaces_options' do - it 'returns groups without being a member for admin' do + describe "#namespaces_options" do + it "returns groups without being a member for admin" do allow(helper).to receive(:current_user).and_return(admin) options = helper.namespaces_options(user_group.id, display_path: true, extra_group: user_group.id) @@ -21,7 +21,7 @@ describe NamespacesHelper do expect(options).to include(user_group.name) end - it 'returns only allowed namespaces for user' do + it "returns only allowed namespaces for user" do allow(helper).to receive(:current_user).and_return(user) options = helper.namespaces_options @@ -31,7 +31,7 @@ describe NamespacesHelper do expect(options).to include(user.name) end - it 'avoids duplicate groups when extra_group is used' do + it "avoids duplicate groups when extra_group is used" do allow(helper).to receive(:current_user).and_return(admin) options = helper.namespaces_options(user_group.id, display_path: true, extra_group: build(:group, name: admin_group.name)) @@ -40,7 +40,7 @@ describe NamespacesHelper do expect(options).to include(admin_group.name) end - it 'selects existing group' do + it "selects existing group" do allow(helper).to receive(:current_user).and_return(admin) options = helper.namespaces_options(:extra_group, display_path: true, extra_group: user_group) @@ -49,20 +49,20 @@ describe NamespacesHelper do expect(options).to include(admin_group.name) end - it 'selects the new group by default' do + it "selects the new group by default" do # Ensure we don't select a group with the same name - create(:group, name: 'new-group', path: 'another-path') + create(:group, name: "new-group", path: "another-path") allow(helper).to receive(:current_user).and_return(user) - options = helper.namespaces_options(:extra_group, display_path: true, extra_group: build(:group, name: 'new-group', path: 'new-group')) + options = helper.namespaces_options(:extra_group, display_path: true, extra_group: build(:group, name: "new-group", path: "new-group")) expect(options).to include(user_group.name) expect(options).not_to include(admin_group.name) expect(options).to include("selected=\"selected\" value=\"-1\"") end - it 'falls back to current user selection' do + it "falls back to current user selection" do allow(helper).to receive(:current_user).and_return(user) options = helper.namespaces_options(:extra_group, display_path: true, extra_group: build(:group, name: admin_group.name)) @@ -72,7 +72,7 @@ describe NamespacesHelper do expect(options).to include("selected=\"selected\" value=\"#{user.namespace.id}\"") end - it 'returns only groups if groups_only option is true' do + it "returns only groups if groups_only option is true" do allow(helper).to receive(:current_user).and_return(user) options = helper.namespaces_options(nil, groups_only: true) @@ -81,8 +81,8 @@ describe NamespacesHelper do expect(options).to include(user_group.name) end - context 'when nested groups are available', :nested_groups do - it 'includes groups nested in groups the user can administer' do + context "when nested groups are available", :nested_groups do + it "includes groups nested in groups the user can administer" do allow(helper).to receive(:current_user).and_return(user) child_group = create(:group, :private, parent: user_group) @@ -91,15 +91,15 @@ describe NamespacesHelper do expect(options).to include(child_group.name) end - it 'orders the groups correctly' do + it "orders the groups correctly" do allow(helper).to receive(:current_user).and_return(user) child_group = create(:group, :private, parent: user_group) other_child = create(:group, :private, parent: user_group) sub_child = create(:group, :private, parent: child_group) expect(helper).to receive(:options_for_group) - .with([user_group, child_group, sub_child, other_child], anything) - .and_call_original + .with([user_group, child_group, sub_child, other_child], anything) + .and_call_original allow(helper).to receive(:options_for_group).and_call_original helper.namespaces_options -- cgit v1.2.1