diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/api/v1/devices_controller_spec.rb | 38 | ||||
-rw-r--r-- | spec/fabricators/device_fabricator.rb | 3 | ||||
-rw-r--r-- | spec/lib/formatter_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/device_spec.rb | 5 |
4 files changed, 1 insertions, 47 deletions
diff --git a/spec/controllers/api/v1/devices_controller_spec.rb b/spec/controllers/api/v1/devices_controller_spec.rb deleted file mode 100644 index 745a462e3..000000000 --- a/spec/controllers/api/v1/devices_controller_spec.rb +++ /dev/null @@ -1,38 +0,0 @@ -require 'rails_helper' - -RSpec.describe Api::V1::DevicesController, type: :controller do - let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } - let(:token) { double acceptable?: true, resource_owner_id: user.id } - - before do - allow(controller).to receive(:doorkeeper_token) { token } - end - - describe 'POST #register' do - before do - post :register, params: { registration_id: 'foo123' } - end - - it 'returns http success' do - expect(response).to have_http_status(:success) - end - - it 'registers device' do - expect(Device.where(account: user.account, registration_id: 'foo123').first).to_not be_nil - end - end - - describe 'POST #unregister' do - before do - post :unregister, params: { registration_id: 'foo123' } - end - - it 'returns http success' do - expect(response).to have_http_status(:success) - end - - it 'removes device' do - expect(Device.where(account: user.account, registration_id: 'foo123').first).to be_nil - end - end -end diff --git a/spec/fabricators/device_fabricator.rb b/spec/fabricators/device_fabricator.rb deleted file mode 100644 index 02b24e8b3..000000000 --- a/spec/fabricators/device_fabricator.rb +++ /dev/null @@ -1,3 +0,0 @@ -Fabricator(:device) do - registration_id "12345678" -end diff --git a/spec/lib/formatter_spec.rb b/spec/lib/formatter_spec.rb index 6ec28f5d8..0db1634e9 100644 --- a/spec/lib/formatter_spec.rb +++ b/spec/lib/formatter_spec.rb @@ -17,7 +17,7 @@ RSpec.describe Formatter do end it 'contains a link' do - expect(subject).to match('<a rel="nofollow noopener" target="_blank" href="http://google.com"><span class="invisible">http://</span><span class="ellipsis">google.com</span><span class="invisible"></span></a>') + expect(subject).to match('<a rel="nofollow noopener" target="_blank" href="http://google.com"><span class="invisible">http://</span><span class="">google.com</span><span class="invisible"></span></a>') end end diff --git a/spec/models/device_spec.rb b/spec/models/device_spec.rb deleted file mode 100644 index f56fbf978..000000000 --- a/spec/models/device_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe Device, type: :model do - -end |