Skip to content

Commit

Permalink
Make update script cleaner (#517)
Browse files Browse the repository at this point in the history
  • Loading branch information
brand-it authored Nov 27, 2024
1 parent 71a70b2 commit f18a358
Show file tree
Hide file tree
Showing 19 changed files with 15 additions and 342 deletions.
4 changes: 0 additions & 4 deletions spec/channels/broadcast_channel_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe BroadcastChannel do
pending "add some examples to (or delete) #{__FILE__}"
end
4 changes: 0 additions & 4 deletions spec/channels/job_channel_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe JobChannel do
pending "add some examples to (or delete) #{__FILE__}"
end
4 changes: 0 additions & 4 deletions spec/clients/the_movie_db/search/movie_spec.rb
Original file line number Diff line number Diff line change
@@ -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
4 changes: 0 additions & 4 deletions spec/clients/the_movie_db/search/multi_spec.rb
Original file line number Diff line number Diff line change
@@ -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
4 changes: 0 additions & 4 deletions spec/clients/the_movie_db/tv_spec.rb
Original file line number Diff line number Diff line change
@@ -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
12 changes: 0 additions & 12 deletions spec/components/process_component_spec.rb
Original file line number Diff line number Diff line change
@@ -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
12 changes: 0 additions & 12 deletions spec/components/rip_process_component_spec.rb
Original file line number Diff line number Diff line change
@@ -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
12 changes: 0 additions & 12 deletions spec/components/scan_plex_process_component_spec.rb
Original file line number Diff line number Diff line change
@@ -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
12 changes: 0 additions & 12 deletions spec/components/upload_process_component_spec.rb
Original file line number Diff line number Diff line change
@@ -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
12 changes: 0 additions & 12 deletions spec/components/video_progress_component_spec.rb
Original file line number Diff line number Diff line change
@@ -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
3 changes: 0 additions & 3 deletions spec/helpers/disks_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,3 @@
# end
# end
# end
RSpec.describe DisksHelper do
pending "add some examples to (or delete) #{__FILE__}"
end
3 changes: 0 additions & 3 deletions spec/helpers/episodes_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,3 @@
# end
# end
# end
RSpec.describe EpisodesHelper do
pending "add some examples to (or delete) #{__FILE__}"
end
3 changes: 0 additions & 3 deletions spec/helpers/seasons_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,3 @@
# end
# end
# end
RSpec.describe SeasonsHelper do
pending "add some examples to (or delete) #{__FILE__}"
end
4 changes: 0 additions & 4 deletions spec/requests/config/make_mkvs_request_spec.rb
Original file line number Diff line number Diff line change
@@ -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
103 changes: 15 additions & 88 deletions spec/requests/config/plexes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
4 changes: 0 additions & 4 deletions spec/requests/disks_request_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe 'Disks' do
pending "add some examples to (or delete) #{__FILE__}"
end
116 changes: 0 additions & 116 deletions spec/requests/users_spec.rb
Original file line number Diff line number Diff line change
@@ -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
4 changes: 0 additions & 4 deletions spec/requests/videos_request_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe 'Videos' do
pending "add some examples to (or delete) #{__FILE__}"
end
Loading

0 comments on commit f18a358

Please sign in to comment.