diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index cb3756a..746cebe 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -104,19 +104,6 @@ Style/IfUnlessModifier: - 'app/models/notice.rb' - 'app/models/user.rb' -# Offense count: 17 -# Cop supports --auto-correct. -Style/LeadingCommentSpace: - Exclude: - - 'app/models/notification_services/gtalk_service.rb' - - 'spec/controllers/api/v1/notices_controller_spec.rb' - - 'spec/controllers/api/v1/problems_controller_spec.rb' - - 'spec/models/fabricators_spec.rb' - - 'spec/models/notification_service/campfire_service_spec.rb' - - 'spec/models/notification_service/gtalk_service_spec.rb' - - 'spec/models/notification_service/hoiio_service_spec.rb' - - 'spec/models/notification_service/pushover_service_spec.rb' - # Offense count: 10 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. diff --git a/app/models/notification_services/gtalk_service.rb b/app/models/notification_services/gtalk_service.rb index e68f719..e58f71d 100644 --- a/app/models/notification_services/gtalk_service.rb +++ b/app/models/notification_services/gtalk_service.rb @@ -66,7 +66,7 @@ private end def send_to_muc(client, message) - #TODO: set this so that it can send to multiple rooms like users, nb multiple room joins in one send fail randomly so leave as one room for the moment + # TODO: set this so that it can send to multiple rooms like users, nb multiple room joins in one send fail randomly so leave as one room for the moment muc = Jabber::MUC::SimpleMUCClient.new(client) muc.join(room_id + "/errbit") muc.send(Jabber::Message.new(room_id, message)) diff --git a/spec/controllers/api/v1/notices_controller_spec.rb b/spec/controllers/api/v1/notices_controller_spec.rb index aabd755..fee8fe3 100644 --- a/spec/controllers/api/v1/notices_controller_spec.rb +++ b/spec/controllers/api/v1/notices_controller_spec.rb @@ -14,7 +14,7 @@ describe Api::V1::NoticesController, type: 'controller' do it "should return JSON if JSON is requested" do get :index, auth_token: @user.authentication_token, format: "json" - expect { JSON.load(response.body) }.not_to raise_error #JSON::ParserError) + expect { JSON.load(response.body) }.not_to raise_error # JSON::ParserError) end it "should return XML if XML is requested" do @@ -24,7 +24,7 @@ describe Api::V1::NoticesController, type: 'controller' do it "should return JSON by default" do get :index, auth_token: @user.authentication_token - expect { JSON.load(response.body) }.not_to raise_error #JSON::ParserError) + expect { JSON.load(response.body) }.not_to raise_error # JSON::ParserError) end describe "given a date range" do diff --git a/spec/controllers/api/v1/problems_controller_spec.rb b/spec/controllers/api/v1/problems_controller_spec.rb index 20bce0d..e14bb81 100644 --- a/spec/controllers/api/v1/problems_controller_spec.rb +++ b/spec/controllers/api/v1/problems_controller_spec.rb @@ -13,7 +13,7 @@ describe Api::V1::ProblemsController, type: 'controller' do it "should return JSON if JSON is requested" do get :show, auth_token: @user.authentication_token, format: "json", id: Problem.first.id - expect { JSON.load(response.body) }.not_to raise_error #JSON::ParserError + expect { JSON.load(response.body) }.not_to raise_error # JSON::ParserError end it "should return XML if XML is requested" do @@ -23,7 +23,7 @@ describe Api::V1::ProblemsController, type: 'controller' do it "should return JSON by default" do get :show, auth_token: @user.authentication_token, id: @problem.id - expect { JSON.load(response.body) }.not_to raise_error #JSON::ParserError) + expect { JSON.load(response.body) }.not_to raise_error # JSON::ParserError) end it "should return the correct problem" do @@ -67,7 +67,7 @@ describe Api::V1::ProblemsController, type: 'controller' do it "should return JSON if JSON is requested" do get :index, auth_token: @user.authentication_token, format: "json" - expect { JSON.load(response.body) }.not_to raise_error #JSON::ParserError) + expect { JSON.load(response.body) }.not_to raise_error # JSON::ParserError) end it "should return XML if XML is requested" do @@ -77,7 +77,7 @@ describe Api::V1::ProblemsController, type: 'controller' do it "should return JSON by default" do get :index, auth_token: @user.authentication_token - expect { JSON.load(response.body) }.not_to raise_error #JSON::ParserError) + expect { JSON.load(response.body) }.not_to raise_error # JSON::ParserError) end describe "given a date range" do diff --git a/spec/models/fabricators_spec.rb b/spec/models/fabricators_spec.rb index d6f1ef1..e3a75da 100644 --- a/spec/models/fabricators_spec.rb +++ b/spec/models/fabricators_spec.rb @@ -5,7 +5,7 @@ Fabrication::Config.fabricator_path.each do |folder| end describe "Fabrication" do - #TODO : when 1.8.7 drop support se directly Symbol#sort + # TODO : when 1.8.7 drop support se directly Symbol#sort Fabrication.manager.schematics.keys.sort.each do |fabricator_name| context "Fabricate(:#{fabricator_name})" do subject { Fabricate.build(fabricator_name) } diff --git a/spec/models/notification_service/campfire_service_spec.rb b/spec/models/notification_service/campfire_service_spec.rb index f12d92c..b236c38 100644 --- a/spec/models/notification_service/campfire_service_spec.rb +++ b/spec/models/notification_service/campfire_service_spec.rb @@ -5,12 +5,12 @@ describe NotificationServices::CampfireService, type: 'model' do notification_service = Fabricate :campfire_notification_service, app: notice.app problem = notice.problem - #campy stubbing + # campy stubbing campy = double('CampfireService') allow(Campy::Room).to receive(:new).and_return(campy) allow(campy).to receive(:speak).and_return(true) - #assert + # assert expect(campy).to receive(:speak) notification_service.create_notification(problem) diff --git a/spec/models/notification_service/gtalk_service_spec.rb b/spec/models/notification_service/gtalk_service_spec.rb index 6c98db5..40a7a6d 100644 --- a/spec/models/notification_service/gtalk_service_spec.rb +++ b/spec/models/notification_service/gtalk_service_spec.rb @@ -6,7 +6,7 @@ describe NotificationServices::GtalkService, type: 'model' do notification_service = Fabricate :gtalk_notification_service, app: notice.app problem = notice.problem - #gtalk stubbing + # gtalk stubbing gtalk = double('GtalkService') jid = double("jid") message = double("message") @@ -24,7 +24,7 @@ describe NotificationServices::GtalkService, type: 'model' do expect(Jabber::MUC::SimpleMUCClient).to receive(:new).and_return(gtalk) expect(gtalk).to receive(:join).with(notification_service.room_id + "/errbit") - #assert + # assert expect(gtalk).to receive(:send).exactly(2).times.with(message) expect(gtalk).to receive(:close) @@ -97,7 +97,7 @@ describe NotificationServices::GtalkService, type: 'model' do notification_service = Fabricate :gtalk_notification_service, app: notice.app problem = notice.problem - #gtalk stubbing + # gtalk stubbing gtalk = double('GtalkService') jid = double("jid") message = double("message") @@ -116,7 +116,7 @@ describe NotificationServices::GtalkService, type: 'model' do notification_service.user_id = "" - #assert + # assert expect(gtalk).to receive(:send).with(message) expect(gtalk).to receive(:close) diff --git a/spec/models/notification_service/hoiio_service_spec.rb b/spec/models/notification_service/hoiio_service_spec.rb index 4dc7036..3d823f1 100644 --- a/spec/models/notification_service/hoiio_service_spec.rb +++ b/spec/models/notification_service/hoiio_service_spec.rb @@ -10,7 +10,7 @@ describe NotificationServices::HoiioService, type: 'model' do allow(Hoi::SMS).to receive(:new).and_return(sms) allow(sms).to receive(:send).and_return(true) - #assert + # assert expect(sms).to receive(:send) notification_service.create_notification(problem) diff --git a/spec/models/notification_service/pushover_service_spec.rb b/spec/models/notification_service/pushover_service_spec.rb index d0afabf..9d006be 100644 --- a/spec/models/notification_service/pushover_service_spec.rb +++ b/spec/models/notification_service/pushover_service_spec.rb @@ -10,7 +10,7 @@ describe NotificationServices::PushoverService, type: 'model' do allow(Rushover::Client).to receive(:new).and_return(notification) allow(notification).to receive(:notify).and_return(true) - #assert + # assert expect(notification).to receive(:notify) notification_service.create_notification(problem) -- libgit2 0.21.2