Skip to content

Commit

Permalink
add test for non exitsting order in sort and remove useless config:
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriyAndriyovuch committed Sep 24, 2023
1 parent 6eb2a76 commit c30a76d
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
2 changes: 0 additions & 2 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@
config.include Devise::Test::IntegrationHelpers, type: :helper
config.include Devise::Test::ControllerHelpers, type: :controller

config.include Capybara::DSL, type: :request

config.add_formatter "Fuubar"
config.fuubar_output_pending_results = false
end
Expand Down
7 changes: 7 additions & 0 deletions spec/requests/account/users_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@
expect(response).not_to be_successful
expect(flash[:alert]).to eq(I18n.t("sort.sort_error"))
end

it "by non existing order" do
get account_users_path(sort: "id byascending")

expect(response).not_to be_successful
expect(flash[:alert]).to eq(I18n.t("sort.sort_error"))
end
end

describe "GET #new" do
Expand Down
7 changes: 7 additions & 0 deletions spec/requests/calculators_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@
expect(response).not_to be_successful
expect(flash[:alert]).to eq(I18n.t("sort.sort_error"))
end

it "by non existing order" do
get account_calculators_path(sort: "id byascending")

expect(response).not_to be_successful
expect(flash[:alert]).to eq(I18n.t("sort.sort_error"))
end
end

describe "POST #create" do
Expand Down
7 changes: 7 additions & 0 deletions spec/requests/categories_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
expect(response).not_to be_successful
expect(flash[:alert]).to eq(I18n.t("sort.sort_error"))
end

it "by non existing order" do
get account_categories_path(sort: "id byascending")

expect(response).not_to be_successful
expect(flash[:alert]).to eq(I18n.t("sort.sort_error"))
end
end

describe "GET :new" do
Expand Down
7 changes: 7 additions & 0 deletions spec/requests/products_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@
expect(response).not_to be_successful
expect(flash[:alert]).to eq(I18n.t("sort.sort_error"))
end

it "by non existing order" do
get account_products_path(sort: "id byascending")

expect(response).not_to be_successful
expect(flash[:alert]).to eq(I18n.t("sort.sort_error"))
end
end

describe "GET :new" do
Expand Down

0 comments on commit c30a76d

Please sign in to comment.