From f18a3581460a279989a862d2ce8e1c97e9f2ae69 Mon Sep 17 00:00:00 2001 From: Brandt Lareau Date: Tue, 26 Nov 2024 16:17:45 -0800 Subject: [PATCH] Make update script cleaner (#517) --- spec/channels/broadcast_channel_spec.rb | 4 - spec/channels/job_channel_spec.rb | 4 - .../clients/the_movie_db/search/movie_spec.rb | 4 - .../clients/the_movie_db/search/multi_spec.rb | 4 - spec/clients/the_movie_db/tv_spec.rb | 4 - spec/components/process_component_spec.rb | 12 -- spec/components/rip_process_component_spec.rb | 12 -- .../scan_plex_process_component_spec.rb | 12 -- .../upload_process_component_spec.rb | 12 -- .../video_progress_component_spec.rb | 12 -- spec/helpers/disks_helper_spec.rb | 3 - spec/helpers/episodes_helper_spec.rb | 3 - spec/helpers/seasons_helper_spec.rb | 3 - .../requests/config/make_mkvs_request_spec.rb | 4 - spec/requests/config/plexes_spec.rb | 103 +++------------- spec/requests/disks_request_spec.rb | 4 - spec/requests/users_spec.rb | 116 ------------------ spec/requests/videos_request_spec.rb | 4 - .../config/the_movie_dbs_routing_spec.rb | 37 ------ 19 files changed, 15 insertions(+), 342 deletions(-) diff --git a/spec/channels/broadcast_channel_spec.rb b/spec/channels/broadcast_channel_spec.rb index 6780cead..ccfa9ee8 100644 --- a/spec/channels/broadcast_channel_spec.rb +++ b/spec/channels/broadcast_channel_spec.rb @@ -1,7 +1,3 @@ # frozen_string_literal: true require 'rails_helper' - -RSpec.describe BroadcastChannel do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/channels/job_channel_spec.rb b/spec/channels/job_channel_spec.rb index 79dfaf63..ccfa9ee8 100644 --- a/spec/channels/job_channel_spec.rb +++ b/spec/channels/job_channel_spec.rb @@ -1,7 +1,3 @@ # frozen_string_literal: true require 'rails_helper' - -RSpec.describe JobChannel do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/clients/the_movie_db/search/movie_spec.rb b/spec/clients/the_movie_db/search/movie_spec.rb index e83f62b7..ccfa9ee8 100644 --- a/spec/clients/the_movie_db/search/movie_spec.rb +++ b/spec/clients/the_movie_db/search/movie_spec.rb @@ -1,7 +1,3 @@ # frozen_string_literal: true require 'rails_helper' - -RSpec.describe TheMovieDb::Search::Movie do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/clients/the_movie_db/search/multi_spec.rb b/spec/clients/the_movie_db/search/multi_spec.rb index 21eab1b6..ccfa9ee8 100644 --- a/spec/clients/the_movie_db/search/multi_spec.rb +++ b/spec/clients/the_movie_db/search/multi_spec.rb @@ -1,7 +1,3 @@ # frozen_string_literal: true require 'rails_helper' - -RSpec.describe TheMovieDb::Search::Multi do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/clients/the_movie_db/tv_spec.rb b/spec/clients/the_movie_db/tv_spec.rb index df434b8d..ccfa9ee8 100644 --- a/spec/clients/the_movie_db/tv_spec.rb +++ b/spec/clients/the_movie_db/tv_spec.rb @@ -1,7 +1,3 @@ # frozen_string_literal: true require 'rails_helper' - -RSpec.describe TheMovieDb::Tv do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/components/process_component_spec.rb b/spec/components/process_component_spec.rb index 50fa2c4c..ccfa9ee8 100644 --- a/spec/components/process_component_spec.rb +++ b/spec/components/process_component_spec.rb @@ -1,15 +1,3 @@ # frozen_string_literal: true require 'rails_helper' - -RSpec.describe ProcessComponent, type: :component do - pending "add some examples to (or delete) #{__FILE__}" - - # it "renders something useful" do - # expect( - # render_inline(described_class.new(attr: "value")) { "Hello, components!" }.css("p").to_html - # ).to include( - # "Hello, components!" - # ) - # end -end diff --git a/spec/components/rip_process_component_spec.rb b/spec/components/rip_process_component_spec.rb index c45b320d..ccfa9ee8 100644 --- a/spec/components/rip_process_component_spec.rb +++ b/spec/components/rip_process_component_spec.rb @@ -1,15 +1,3 @@ # frozen_string_literal: true require 'rails_helper' - -RSpec.describe RipProcessComponent, type: :component do - pending "add some examples to (or delete) #{__FILE__}" - - # it "renders something useful" do - # expect( - # render_inline(described_class.new(attr: "value")) { "Hello, components!" }.css("p").to_html - # ).to include( - # "Hello, components!" - # ) - # end -end diff --git a/spec/components/scan_plex_process_component_spec.rb b/spec/components/scan_plex_process_component_spec.rb index fe60d6fb..ccfa9ee8 100644 --- a/spec/components/scan_plex_process_component_spec.rb +++ b/spec/components/scan_plex_process_component_spec.rb @@ -1,15 +1,3 @@ # frozen_string_literal: true require 'rails_helper' - -RSpec.describe ScanPlexProcessComponent, type: :component do - pending "add some examples to (or delete) #{__FILE__}" - - # it "renders something useful" do - # expect( - # render_inline(described_class.new(attr: "value")) { "Hello, components!" }.css("p").to_html - # ).to include( - # "Hello, components!" - # ) - # end -end diff --git a/spec/components/upload_process_component_spec.rb b/spec/components/upload_process_component_spec.rb index e69f7e4d..ccfa9ee8 100644 --- a/spec/components/upload_process_component_spec.rb +++ b/spec/components/upload_process_component_spec.rb @@ -1,15 +1,3 @@ # frozen_string_literal: true require 'rails_helper' - -RSpec.describe UploadProcessComponent, type: :component do - pending "add some examples to (or delete) #{__FILE__}" - - # it "renders something useful" do - # expect( - # render_inline(described_class.new(attr: "value")) { "Hello, components!" }.css("p").to_html - # ).to include( - # "Hello, components!" - # ) - # end -end diff --git a/spec/components/video_progress_component_spec.rb b/spec/components/video_progress_component_spec.rb index 25935815..ccfa9ee8 100644 --- a/spec/components/video_progress_component_spec.rb +++ b/spec/components/video_progress_component_spec.rb @@ -1,15 +1,3 @@ # frozen_string_literal: true require 'rails_helper' - -RSpec.describe VideoProgressComponent, type: :component do - pending "add some examples to (or delete) #{__FILE__}" - - # it "renders something useful" do - # expect( - # render_inline(described_class.new(attr: "value")) { "Hello, components!" }.css("p").to_html - # ).to include( - # "Hello, components!" - # ) - # end -end diff --git a/spec/helpers/disks_helper_spec.rb b/spec/helpers/disks_helper_spec.rb index fd80c524..73ab1180 100644 --- a/spec/helpers/disks_helper_spec.rb +++ b/spec/helpers/disks_helper_spec.rb @@ -12,6 +12,3 @@ # end # end # end -RSpec.describe DisksHelper do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/helpers/episodes_helper_spec.rb b/spec/helpers/episodes_helper_spec.rb index 6bdb5976..a32942b9 100644 --- a/spec/helpers/episodes_helper_spec.rb +++ b/spec/helpers/episodes_helper_spec.rb @@ -12,6 +12,3 @@ # end # end # end -RSpec.describe EpisodesHelper do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/helpers/seasons_helper_spec.rb b/spec/helpers/seasons_helper_spec.rb index f4aaed40..8e268943 100644 --- a/spec/helpers/seasons_helper_spec.rb +++ b/spec/helpers/seasons_helper_spec.rb @@ -12,6 +12,3 @@ # end # end # end -RSpec.describe SeasonsHelper do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/requests/config/make_mkvs_request_spec.rb b/spec/requests/config/make_mkvs_request_spec.rb index 82707d54..ccfa9ee8 100644 --- a/spec/requests/config/make_mkvs_request_spec.rb +++ b/spec/requests/config/make_mkvs_request_spec.rb @@ -1,7 +1,3 @@ # frozen_string_literal: true require 'rails_helper' - -RSpec.describe 'Config::MakeMkvs' do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/requests/config/plexes_spec.rb b/spec/requests/config/plexes_spec.rb index ced5ba24..d7ffa133 100644 --- a/spec/requests/config/plexes_spec.rb +++ b/spec/requests/config/plexes_spec.rb @@ -5,21 +5,21 @@ RSpec.describe '/config/plexes' do before { create(:config_make_mkv) } - let(:valid_attributes) do - skip('Add a hash of attributes valid for your model') - end - - let(:invalid_attributes) do - skip('Add a hash of attributes invalid for your model') - end - - describe 'GET /index' do - it 'renders a successful response' do - Config::Plex.create! valid_attributes - get config_plex_url - expect(response).to be_successful - end - end + # let(:valid_attributes) do + # { config_plex: {} } + # end + + # let(:invalid_attributes) do + # { config_plex: {} } + # end + + # describe 'GET /index' do + # it 'renders a successful response' do + # Config::Plex.create! valid_attributes + # get config_plex_url + # expect(response).to be_successful + # end + # end describe 'GET /show' do it 'renders a successful response' do @@ -43,77 +43,4 @@ expect(response).to be_successful end end - - describe 'POST /create' do - context 'with valid parameters' do - it 'creates a new Config::Plex' do - expect do - post config_plex_url, params: { config_plex: valid_attributes } - end.to change(Config::Plex, :count).by(1) - end - - it 'redirects to the created config_plex' do - post config_plex_url, params: { config_plex: valid_attributes } - expect(response).to redirect_to(config_plex_url) - end - end - - context 'with invalid parameters' do - it 'does not create a new Config::Plex' do - expect do - post config_plex_url, params: { config_plex: invalid_attributes } - end.not_to change(Config::Plex, :count) - end - - it "renders a successful response (i.e. to display the 'new' template)" do - post config_plex_url, params: { config_plex: invalid_attributes } - expect(response).to be_successful - end - end - end - - describe 'PATCH /update' do - context 'with valid parameters' do - let(:new_attributes) do - skip('Add a hash of attributes valid for your model') - end - - it 'updates the requested config_plex' do - plex = Config::Plex.create! valid_attributes - patch config_plex_url(config_plex), params: { config_plex: new_attributes } - plex.reload - skip('Add assertions for updated state') - end - - it 'redirects to the config_plex' do - plex = Config::Plex.create! valid_attributes - patch config_plex_url(config_plex), params: { config_plex: new_attributes } - plex.reload - expect(response).to redirect_to(config_plex_url(plex)) - end - end - - context 'with invalid parameters' do - it "renders a successful response (i.e. to display the 'edit' template)" do - Config::Plex.create! valid_attributes - patch config_plex_url(config_plex), params: { config_plex: invalid_attributes } - expect(response).to be_successful - end - end - end - - describe 'DELETE /destroy' do - it 'destroys the requested config_plex' do - Config::Plex.create! valid_attributes - expect do - delete config_plex_url(config_plex) - end.to change(Config::Plex, :count).by(-1) - end - - it 'redirects to the config_plexes list' do - Config::Plex.create! valid_attributes - delete config_plex_url(config_plex) - expect(response).to redirect_to(config_plex_url) - end - end end diff --git a/spec/requests/disks_request_spec.rb b/spec/requests/disks_request_spec.rb index 5c4fcfda..ccfa9ee8 100644 --- a/spec/requests/disks_request_spec.rb +++ b/spec/requests/disks_request_spec.rb @@ -1,7 +1,3 @@ # frozen_string_literal: true require 'rails_helper' - -RSpec.describe 'Disks' do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/requests/users_spec.rb b/spec/requests/users_spec.rb index d1c3e9a1..ccfa9ee8 100644 --- a/spec/requests/users_spec.rb +++ b/spec/requests/users_spec.rb @@ -1,119 +1,3 @@ # frozen_string_literal: true require 'rails_helper' - -RSpec.describe '/users' do - before { create(:config_make_mkv) } - - let(:valid_attributes) do - skip('Add a hash of attributes valid for your model') - end - - let(:invalid_attributes) do - skip('Add a hash of attributes invalid for your model') - end - - describe 'GET /index' do - it 'renders a successful response' do - User.create! valid_attributes - get users_url - expect(response).to be_successful - end - end - - describe 'GET /show' do - it 'renders a successful response' do - user = User.create! valid_attributes - get user_url(user) - expect(response).to be_successful - end - end - - describe 'GET /new' do - it 'renders a successful response' do - get new_user_url - expect(response).to be_successful - end - end - - describe 'GET /edit' do - it 'render a successful response' do - user = User.create! valid_attributes - get edit_user_url(user) - expect(response).to be_successful - end - end - - describe 'POST /create' do - context 'with valid parameters' do - it 'creates a new User' do - expect do - post users_url, params: { user: valid_attributes } - end.to change(User, :count).by(1) - end - - it 'redirects to the created user' do - post users_url, params: { user: valid_attributes } - expect(response).to redirect_to(user_url(User.last)) - end - end - - context 'with invalid parameters' do - it 'does not create a new User' do - expect do - post users_url, params: { user: invalid_attributes } - end.not_to change(User, :count) - end - - it "renders a successful response (i.e. to display the 'new' template)" do - post users_url, params: { user: invalid_attributes } - expect(response).to be_successful - end - end - end - - describe 'PATCH /update' do - context 'with valid parameters' do - let(:new_attributes) do - skip('Add a hash of attributes valid for your model') - end - - it 'updates the requested user' do - user = User.create! valid_attributes - patch user_url(user), params: { user: new_attributes } - user.reload - skip('Add assertions for updated state') - end - - it 'redirects to the user' do - user = User.create! valid_attributes - patch user_url(user), params: { user: new_attributes } - user.reload - expect(response).to redirect_to(user_url(user)) - end - end - - context 'with invalid parameters' do - it "renders a successful response (i.e. to display the 'edit' template)" do - user = User.create! valid_attributes - patch user_url(user), params: { user: invalid_attributes } - expect(response).to be_successful - end - end - end - - describe 'DELETE /destroy' do - it 'destroys the requested user' do - user = User.create! valid_attributes - expect do - delete user_url(user) - end.to change(User, :count).by(-1) - end - - it 'redirects to the users list' do - user = User.create! valid_attributes - delete user_url(user) - expect(response).to redirect_to(users_url) - end - end -end diff --git a/spec/requests/videos_request_spec.rb b/spec/requests/videos_request_spec.rb index 19a750ed..ccfa9ee8 100644 --- a/spec/requests/videos_request_spec.rb +++ b/spec/requests/videos_request_spec.rb @@ -1,7 +1,3 @@ # frozen_string_literal: true require 'rails_helper' - -RSpec.describe 'Videos' do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/routing/config/the_movie_dbs_routing_spec.rb b/spec/routing/config/the_movie_dbs_routing_spec.rb index 3c11d494..ccfa9ee8 100644 --- a/spec/routing/config/the_movie_dbs_routing_spec.rb +++ b/spec/routing/config/the_movie_dbs_routing_spec.rb @@ -1,40 +1,3 @@ # frozen_string_literal: true require 'rails_helper' - -RSpec.describe Config::TheMovieDbsController do - pending "add some examples to (or delete) #{__FILE__}" - # describe 'routing' do - # it 'routes to #index' do - # expect(get: '/config/the_movie_dbs').to route_to('config/the_movie_dbs#index') - # end - - # it 'routes to #new' do - # expect(get: '/config/the_movie_dbs/new').to route_to('config/the_movie_dbs#new') - # end - - # it 'routes to #show' do - # expect(get: '/config/the_movie_dbs/1').to route_to('config/the_movie_dbs#show', id: '1') - # end - - # it 'routes to #edit' do - # expect(get: '/config/the_movie_dbs/1/edit').to route_to('config/the_movie_dbs#edit', id: '1') - # end - - # it 'routes to #create' do - # expect(post: '/config/the_movie_dbs').to route_to('config/the_movie_dbs#create') - # end - - # it 'routes to #update via PUT' do - # expect(put: '/config/the_movie_dbs/1').to route_to('config/the_movie_dbs#update', id: '1') - # end - - # it 'routes to #update via PATCH' do - # expect(patch: '/config/the_movie_dbs/1').to route_to('config/the_movie_dbs#update', id: '1') - # end - - # it 'routes to #destroy' do - # expect(delete: '/config/the_movie_dbs/1').to route_to('config/the_movie_dbs#destroy', id: '1') - # end - # end -end