update to 1.0.5

(cherry picked from commit 949fcc062fff1c80211db7d049dc2fd9150d37b8)
This commit is contained in:
liqiuyu 2022-03-03 13:53:57 +08:00 committed by openeuler-sync-bot
parent 3a597aef05
commit f93afc9712
5 changed files with 79 additions and 9 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,63 @@
From 23e9befe7e5747ab648e8558ccd76a5b229e452b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Tue, 9 Feb 2021 11:59:38 +0100
Subject: [PATCH] Disable relative template test cases
Relative templates are not supported since Rails 6.1:
https://travis-ci.org/github/rails/rails-controller-testing/jobs/705868237
Fixes #64
---
test/controllers/template_assertions_test.rb | 8 ++++++--
test/integration/template_assertions_test.rb | 4 ++++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/test/controllers/template_assertions_test.rb b/test/controllers/template_assertions_test.rb
index d1a6fa3..1e18c91 100644
--- a/test/controllers/template_assertions_test.rb
+++ b/test/controllers/template_assertions_test.rb
@@ -13,6 +13,8 @@ def test_with_partial
end
def test_file_with_relative_path_success
+ skip "Deprecated in ActionPack 6.1+" if ActionPack.version >= Gem::Version.new('6.1')
+
get :render_file_relative_path
assert_template file: 'README.rdoc'
end
@@ -179,8 +181,10 @@ def test_assert_template_reset_between_requests
get :render_nothing
assert_template layout: nil
- get :render_file_relative_path
- assert_template file: 'README.rdoc'
+ if ActionPack.version < Gem::Version.new('6.1')
+ get :render_file_relative_path
+ assert_template file: 'README.rdoc'
+ end
get :render_nothing
assert_template file: nil
diff --git a/test/integration/template_assertions_test.rb b/test/integration/template_assertions_test.rb
index 0924016..381687b 100644
--- a/test/integration/template_assertions_test.rb
+++ b/test/integration/template_assertions_test.rb
@@ -26,6 +26,8 @@ def test_layout_reset_between_requests
end
def test_file_reset_between_requests
+ skip "Deprecated in ActionPack 6.1+" if ActionPack.version >= Gem::Version.new('6.1')
+
get '/template_assertions/render_file_relative_path'
assert_template file: 'README.rdoc'
@@ -64,6 +66,8 @@ def test_layout_reset_between_requests_when_opening_a_session
end
def test_file_reset_between_requests_when_opening_a_session
+ skip "Deprecated in ActionPack 6.1+" if ActionPack.version >= Gem::Version.new('6.1')
+
open_session do |session|
session.get '/template_assertions/render_file_relative_path'
session.assert_template file: 'README.rdoc'

View File

@ -1,14 +1,18 @@
%global gem_name rails-controller-testing %global gem_name rails-controller-testing
Name: rubygem-%{gem_name} Name: rubygem-%{gem_name}
Version: 1.0.2 Version: 1.0.5
Release: 1 Release: 1
Summary: Extracting `assigns` and `assert_template` from ActionDispatch Summary: Extracting `assigns` and `assert_template` from ActionDispatch
License: MIT License: MIT
URL: https://github.com/rails/rails-controller-testing URL: https://github.com/rails/rails-controller-testing
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
Patch0: %{name}-rails6.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: rubygems-devel rubygem(railties) => 5.0.1 rubygem(railties) < 6 BuildRequires: ruby(release)
BuildRequires: rubygem(sqlite3) BuildRequires: rubygems-devel
BuildRequires: ruby >= 2.2.2
BuildRequires: rubygem(railties) >= 5.0.1
%description %description
This gem brings back assigns to your controller tests as well as This gem brings back assigns to your controller tests as well as
assert_template to both controller and integration tests. assert_template to both controller and integration tests.
@ -21,13 +25,11 @@ Requires: %{name} = %{version}-%{release}
Documentation for %{name}. Documentation for %{name}.
%prep %prep
gem unpack %{SOURCE0} %setup -q -n %{gem_name}-%{version}
%setup -q -D -T -n %{gem_name}-%{version} %patch0 -p1
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
sed -i '/^Bundler/d' test/dummy/config/application.rb
%build %build
gem build %{gem_name}.gemspec gem build ../%{gem_name}-%{version}.gemspec
%gem_install %gem_install
%install %install
@ -37,7 +39,9 @@ cp -a .%{gem_dir}/* \
%check %check
pushd .%{gem_instdir} pushd .%{gem_instdir}
ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)' # kill the bundler
sed -i '/^Bundler/ s/^/#/' test/dummy/config/application.rb
ruby -Itest -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
popd popd
%files %files
@ -54,5 +58,8 @@ popd
%{gem_instdir}/Rakefile %{gem_instdir}/Rakefile
%changelog %changelog
* Thur Mar 3 2022 liqiuyu <liqiuyu@kylinos.cn> - 1.0.5-1
- update to 1.0.5
* Thu Aug 20 2020 luoshengwei <luoshengwei@huawei.com> - 1.0.2-1 * Thu Aug 20 2020 luoshengwei <luoshengwei@huawei.com> - 1.0.2-1
- package init - package init