about summary refs log tree commit diff
path: root/spec/models
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/account_spec.rb2
-rw-r--r--spec/models/concerns/remotable_spec.rb13
-rw-r--r--spec/models/subscription_spec.rb2
3 files changed, 14 insertions, 3 deletions
diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb
index 8fb5bbddf..6a3f9e6ec 100644
--- a/spec/models/account_spec.rb
+++ b/spec/models/account_spec.rb
@@ -559,7 +559,7 @@ RSpec.describe Account, type: :model do
     end
 
     context 'when is local' do
-      it 'is invalid if the username is not unique in case-insensitive comparsion among local accounts' do
+      it 'is invalid if the username is not unique in case-insensitive comparison among local accounts' do
         account_1 = Fabricate(:account, username: 'the_doctor')
         account_2 = Fabricate.build(:account, username: 'the_Doctor')
         account_2.valid?
diff --git a/spec/models/concerns/remotable_spec.rb b/spec/models/concerns/remotable_spec.rb
index b39233739..a4289cc45 100644
--- a/spec/models/concerns/remotable_spec.rb
+++ b/spec/models/concerns/remotable_spec.rb
@@ -88,7 +88,18 @@ RSpec.describe Remotable do
 
       context 'parsed_url.host is empty' do
         it 'makes no request' do
-          parsed_url = double(scheme: 'https', host: double(empty?: true))
+          parsed_url = double(scheme: 'https', host: double(blank?: true))
+          allow(Addressable::URI).to receive_message_chain(:parse, :normalize)
+            .with(url).with(no_args).and_return(parsed_url)
+
+          foo.hoge_remote_url = url
+          expect(request).not_to have_been_requested
+        end
+      end
+
+      context 'parsed_url.host is nil' do
+        it 'makes no request' do
+          parsed_url = Addressable::URI.parse('https:https://example.com/path/file.png')
           allow(Addressable::URI).to receive_message_chain(:parse, :normalize)
             .with(url).with(no_args).and_return(parsed_url)
 
diff --git a/spec/models/subscription_spec.rb b/spec/models/subscription_spec.rb
index 84096e6ae..b83979d13 100644
--- a/spec/models/subscription_spec.rb
+++ b/spec/models/subscription_spec.rb
@@ -18,7 +18,7 @@ RSpec.describe Subscription, type: :model do
   end
 
   describe 'lease_seconds' do
-    it 'returns the time remaing until expiration' do
+    it 'returns the time remaining until expiration' do
       datetime = 1.day.from_now
       subscription = Subscription.new(expires_at: datetime)
       travel_to(datetime - 12.hours) do