Use the new fork gem

This commit is contained in:
Jyri-Petteri Paloposki 2021-08-25 17:15:34 +03:00
parent 64002c632f
commit 6c0d3ca1b3
3 changed files with 15 additions and 20 deletions

View file

@ -19,13 +19,13 @@ gem 'uglifier', '>=1.3.0'
gem 'aasm', '~> 5.2.0' gem 'aasm', '~> 5.2.0'
gem 'acts_as_list' gem 'acts_as_list'
gem 'bcrypt', '~> 3.1.16' gem 'bcrypt', '~> 3.1.16'
gem 'chartjs-ror', :git => 'git://github.com/ZeiP/chartjs-ror.git'
gem 'htmlentities' gem 'htmlentities'
gem 'paperclip' gem 'paperclip'
gem 'puma', '~> 5.4' gem 'puma', '~> 5.4'
gem 'rails_autolink' gem 'rails_autolink'
gem 'RedCloth' gem 'RedCloth'
gem 'sanitize', '~> 6.0' gem 'sanitize', '~> 6.0'
gem 'tracks-chartjs-ror'
gem 'will_paginate' gem 'will_paginate'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes # See https://github.com/sstephenson/execjs#readme for more supported runtimes

View file

@ -1,10 +1,3 @@
GIT
remote: git://github.com/ZeiP/chartjs-ror.git
revision: e9d3aabbda3059c001144833d915a386d8b511c5
specs:
chartjs-ror (3.6.4)
rails (>= 3.1)
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
@ -305,6 +298,8 @@ GEM
rails (>= 5.0) rails (>= 5.0)
safe_yaml (>= 0.8.6) safe_yaml (>= 0.8.6)
sassc sassc
tracks-chartjs-ror (3.6.4)
rails (>= 3.1)
tzinfo (1.2.9) tzinfo (1.2.9)
thread_safe (~> 0.1) thread_safe (~> 0.1)
uglifier (4.2.0) uglifier (4.2.0)
@ -331,7 +326,6 @@ DEPENDENCIES
bootstrap-sass (= 3.4.1) bootstrap-sass (= 3.4.1)
bullet bullet
byebug byebug
chartjs-ror!
codeclimate-test-reporter (= 1.0.7) codeclimate-test-reporter (= 1.0.7)
coffee-rails (~> 5.0.0) coffee-rails (~> 5.0.0)
database_cleaner database_cleaner
@ -363,9 +357,10 @@ DEPENDENCIES
sqlite3 sqlite3
therubyracer therubyracer
tolk (~> 4.1.0) tolk (~> 4.1.0)
tracks-chartjs-ror
uglifier (>= 1.3.0) uglifier (>= 1.3.0)
will_paginate will_paginate
yard yard
BUNDLED WITH BUNDLED WITH
2.1.4 2.2.22

View file

@ -3,7 +3,7 @@ require 'test_helper'
class ProjectXmlApiTest < ActionDispatch::IntegrationTest class ProjectXmlApiTest < ActionDispatch::IntegrationTest
@@project_name = "My New Project" @@project_name = "My New Project"
@@valid_postdata = "<project><name>#{@@project_name}</name></project>" @@valid_postdata = "<project><name>#{@@project_name}</name></project>"
def test_retrieve_project def test_retrieve_project
authenticated_get_xml "/projects/1.xml", users(:admin_user).login, 'abracadabra', {} authenticated_get_xml "/projects/1.xml", users(:admin_user).login, 'abracadabra', {}
assert_select 'project' do assert_select 'project' do
@ -20,37 +20,37 @@ class ProjectXmlApiTest < ActionDispatch::IntegrationTest
# authenticated_post_xml_to_project_create "<foo></bar>" # authenticated_post_xml_to_project_create "<foo></bar>"
# assert_equal 500, @integration_session.status # assert_equal 500, @integration_session.status
end end
def test_fails_with_invalid_xml_format2 def test_fails_with_invalid_xml_format2
authenticated_post_xml_to_project_create "<project><name></name></project>" authenticated_post_xml_to_project_create "<project><name></name></project>"
assert_responses_with_error 'Name project must have a name' assert_responses_with_error 'Name project must have a name'
end end
def test_xml_simple_param_parsing def test_xml_simple_param_parsing
authenticated_post_xml_to_project_create authenticated_post_xml_to_project_create
assert @controller.params.has_key?(:project) assert @controller.params.has_key?(:project)
assert @controller.params[:project].has_key?(:name) assert @controller.params[:project].has_key?(:name)
assert_equal @@project_name, @controller.params[:project][:name] assert_equal @@project_name, @controller.params[:project][:name]
end end
def test_fails_with_401_if_not_authorized_user def test_fails_with_401_if_not_authorized_user
authenticated_post_xml_to_project_create @@valid_postdata, 'nobody', 'nohow' authenticated_post_xml_to_project_create @@valid_postdata, 'nobody', 'nohow'
assert_response 401 assert_response 401
end end
def test_fails_with_too_long_name def test_fails_with_too_long_name
invalid_with_long_name_postdata = "<project><name>foobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoo arfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoo arfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfo barfoobarfoobarfoobarfoobarfoobarfoobar</name></project>" invalid_with_long_name_postdata = "<project><name>foobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoo arfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoo arfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfo barfoobarfoobarfoobarfoobarfoobarfoobar</name></project>"
authenticated_post_xml_to_project_create invalid_with_long_name_postdata authenticated_post_xml_to_project_create invalid_with_long_name_postdata
assert_responses_with_error 'Name context name must be less than 256 characters' assert_responses_with_error 'Name context name must be less than 256 characters'
end end
def test_fails_with_comma_in_name def test_fails_with_comma_in_name
authenticated_post_xml_to_project_create "<project><name>foo,bar</name></project>" authenticated_post_xml_to_project_create "<project><name>foo,bar</name></project>"
assert_response :created assert_response :created
project1 = Project.where(:name => "foo,bar").first project1 = Project.where(:name => "foo,bar").first
assert_not_nil project1, "expected project 'foo,bar' to be created" assert_not_nil project1, "expected project 'foo,bar' to be created"
end end
def test_creates_new_project def test_creates_new_project
assert_difference 'Project.count' do assert_difference 'Project.count' do
authenticated_post_xml_to_project_create authenticated_post_xml_to_project_create
@ -59,9 +59,9 @@ class ProjectXmlApiTest < ActionDispatch::IntegrationTest
project1 = Project.where(:name => @@project_name).first project1 = Project.where(:name => @@project_name).first
assert_not_nil project1, "expected project '#{@@project_name}' to be created" assert_not_nil project1, "expected project '#{@@project_name}' to be created"
end end
private private
def authenticated_post_xml_to_project_create(postdata = @@valid_postdata, user = users(:other_user).login, password = 'sesame') def authenticated_post_xml_to_project_create(postdata = @@valid_postdata, user = users(:other_user).login, password = 'sesame')
authenticated_post_xml "/projects.xml", user, password, postdata authenticated_post_xml "/projects.xml", user, password, postdata
end end
@ -69,5 +69,5 @@ class ProjectXmlApiTest < ActionDispatch::IntegrationTest
def assert_404_invalid_xml def assert_404_invalid_xml
assert_response_and_body 404, "Expected post format is valid xml like so: <project><name>project name</name></project>." assert_response_and_body 404, "Expected post format is valid xml like so: <project><name>project name</name></project>."
end end
end end