mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Enable Style/SingleLineMethods and Style/Semicolon in Rubocop (#6717)
This commit is contained in:
committed by
Guo Xiang Tan
parent
56948896ff
commit
9248ad1905
@@ -3,7 +3,9 @@ require 'rails_helper'
|
||||
describe Auth::ManagedAuthenticator do
|
||||
let(:authenticator) {
|
||||
Class.new(described_class) do
|
||||
def name; "myauth" end
|
||||
def name
|
||||
"myauth"
|
||||
end
|
||||
end.new
|
||||
}
|
||||
|
||||
@@ -55,8 +57,12 @@ describe Auth::ManagedAuthenticator do
|
||||
|
||||
it 'does not work when disabled' do
|
||||
authenticator = Class.new(described_class) do
|
||||
def name; "myauth" end
|
||||
def can_connect_existing_user?; false end
|
||||
def name
|
||||
"myauth"
|
||||
end
|
||||
def can_connect_existing_user?
|
||||
false
|
||||
end
|
||||
end.new
|
||||
result = authenticator.after_authenticate(hash, existing_account: user2)
|
||||
expect(result.user.id).to eq(user1.id)
|
||||
@@ -81,8 +87,12 @@ describe Auth::ManagedAuthenticator do
|
||||
|
||||
it 'does not match if match_by_email is false' do
|
||||
authenticator = Class.new(described_class) do
|
||||
def name; "myauth" end
|
||||
def match_by_email; false end
|
||||
def name
|
||||
"myauth"
|
||||
end
|
||||
def match_by_email
|
||||
false
|
||||
end
|
||||
end.new
|
||||
user = Fabricate(:user, email: "awesome@example.com")
|
||||
result = authenticator.after_authenticate(hash)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
require 'rails_helper';
|
||||
require 'rails_helper'
|
||||
|
||||
require 'guardian'
|
||||
require_dependency 'post_destroyer'
|
||||
|
||||
@@ -36,7 +36,9 @@ describe Plugin::Instance do
|
||||
|
||||
class TroutPlugin < Plugin::Instance
|
||||
attr_accessor :enabled
|
||||
def enabled?; @enabled; end
|
||||
def enabled?
|
||||
@enabled
|
||||
end
|
||||
end
|
||||
|
||||
before do
|
||||
|
||||
@@ -1118,13 +1118,13 @@ HTML
|
||||
|
||||
it "supports url bbcode" do
|
||||
cooked = PrettyText.cook "[url]http://sam.com[/url]"
|
||||
html = '<p><a href="http://sam.com" data-bbcode="true" rel="nofollow noopener">http://sam.com</a></p>';
|
||||
html = '<p><a href="http://sam.com" data-bbcode="true" rel="nofollow noopener">http://sam.com</a></p>'
|
||||
expect(cooked).to eq(html)
|
||||
end
|
||||
|
||||
it "supports nesting tags in url" do
|
||||
cooked = PrettyText.cook("[url=http://sam.com][b]I am sam[/b][/url]")
|
||||
html = '<p><a href="http://sam.com" data-bbcode="true" rel="nofollow noopener"><span class="bbcode-b">I am sam</span></a></p>';
|
||||
html = '<p><a href="http://sam.com" data-bbcode="true" rel="nofollow noopener"><span class="bbcode-b">I am sam</span></a></p>'
|
||||
expect(cooked).to eq(html)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user