redmine_extensions 0.2.12 → 0.2.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a0e67941fae9d601328dfb3131e98082e1b5e88
4
- data.tar.gz: 5d488b91d32e196a6a1c550494fa2f96282dab0b
3
+ metadata.gz: f84dc4261d345f5b0bfc2bea6f7dfef762d7bf31
4
+ data.tar.gz: c872ccac1093e94cd5e0831279277ce3312b0ad4
5
5
  SHA512:
6
- metadata.gz: 9be4ff798f2e7d8720b484badfe55cacc50171e36850a5388c0cd922c8c1067b638c0756daa6abb2b60d6c17f329bc22d3d01798bc0c03272dcfa1a74b855510
7
- data.tar.gz: 096391ba35d5ebd3663b5113c4c05f643385acb0b0e07a21159e35d455c1ffd6206b3302c312f5e172593a15b4fcd555ce499cc5f64e1fc6dc56c61bddd0be59
6
+ metadata.gz: c660a03ba12d7ad159f5818d2dbf0d5a9425181e9b24113fc99ce35d997b071801aa74984fb3f2d1b5d37308ce20f25b43ff5563961628566dc874cdfb9a88b9
7
+ data.tar.gz: 1404b7ee3c6132c4a8e6d147345cda6db61d9e843f52b06d0c696cf6b62ca34905ca65a0e8b6e8bd5a2ce094d571990903db4c8a83ed62daa72f87d8d662b47e
@@ -1,8 +1,8 @@
1
1
  require Rails.root.join('plugins', 'easyproject', 'easy_plugins', 'easy_extensions/test/spec/spec_helper')
2
2
 
3
3
  describe <%= controller_class %>Controller, logged: true do
4
- let(:<%= model_name_underscored %>) { FactoryGirl.create(:<%= model_name_underscored %>) }
5
- let(:<%= model_name_pluralize_underscored %>) { FactoryGirl.create_list(:<%= model_name_underscored %>, 5) }
4
+ let(:<%= model_name_underscored %>) { FactoryBot.create(:<%= model_name_underscored %>) }
5
+ let(:<%= model_name_pluralize_underscored %>) { FactoryBot.create_list(:<%= model_name_underscored %>, 5) }
6
6
 
7
7
  before(:each) do
8
8
  role = Role.non_member
@@ -40,7 +40,7 @@ describe <%= controller_class %>Controller, logged: true do
40
40
  end
41
41
 
42
42
  it 'create with valid' do
43
- post :create, {<%= model_name_underscored %>: FactoryGirl.attributes_for(:<%= model_name_underscored %>)}
43
+ post :create, {<%= model_name_underscored %>: FactoryBot.attributes_for(:<%= model_name_underscored %>)}
44
44
  expect(response).to have_http_status(:success)
45
45
  expect(assigns[:<%= model_name_underscored %>]).not_to be_a_new(<%= model_name %>)
46
46
  expect(response).to redirect_to(<%= model_name_underscored %>_path(assigns[:<%= model_name_underscored %>]))
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
 
3
3
  factory :<%= model_name_underscored %> do
4
4
  <%- string_columns.each_key do |c| -%>
@@ -18,6 +18,6 @@ end
18
18
  # in this block should be used require_dependency, but only if necessary.
19
19
  # better is to place a class in file named by rails naming convency and let it be loaded automatically
20
20
  # Here goes query registering, custom fields registering and so on
21
- ActionDispatch::Reloader.to_prepare do
21
+ RedmineExtensions::Reloader.to_prepare do
22
22
 
23
23
  end
@@ -1,3 +1,3 @@
1
1
  module RedmineExtensions
2
- VERSION = '0.2.12'
2
+ VERSION = '0.2.13'
3
3
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :easy_query do
3
3
  name 'Test name'
4
4
  project nil
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :easy_setting do
3
3
 
4
4
  name 'my_setting'
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
 
3
3
  factory :enumeration do
4
4
  name 'TestEnum'
@@ -41,7 +41,7 @@ FactoryGirl.define do
41
41
  start_date { Date.today }
42
42
  due_date { Date.today + 7.days }
43
43
  status { tracker.default_status }
44
- priority { IssuePriority.default || FactoryGirl.create(:issue_priority, :default) }
44
+ priority { IssuePriority.default || FactoryBot.create(:issue_priority, :default) }
45
45
  association :author, :factory => :user, :firstname => "Author"
46
46
  association :assigned_to, :factory => :user, :firstname => "Assignee"
47
47
 
@@ -65,7 +65,7 @@ FactoryGirl.define do
65
65
 
66
66
  trait :with_journals do
67
67
  after(:create) do |issue|
68
- FactoryGirl.create_list(:journal, 2, issue: issue, journalized_type: 'Issue')
68
+ FactoryBot.create_list(:journal, 2, issue: issue, journalized_type: 'Issue')
69
69
  end
70
70
  end
71
71
 
@@ -75,7 +75,7 @@ FactoryGirl.define do
75
75
 
76
76
  trait :with_attachment do
77
77
  after(:create) do |issue|
78
- FactoryGirl.create_list(:attachment, 1, container: issue)
78
+ FactoryBot.create_list(:attachment, 1, container: issue)
79
79
  end
80
80
  end
81
81
 
@@ -83,7 +83,7 @@ FactoryGirl.define do
83
83
 
84
84
  after :build do |issue, evaluator|
85
85
  if evaluator.factory_is_child
86
- issue.parent_issue_id = FactoryGirl.create(:issue, :project => issue.project).id
86
+ issue.parent_issue_id = FactoryBot.create(:issue, :project => issue.project).id
87
87
  end
88
88
  end
89
89
  end
@@ -1,7 +1,7 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :project do
3
3
  transient do
4
- number_of_issues 1
4
+ number_of_issues 0
5
5
  number_of_members 0
6
6
  number_of_issue_categories 2
7
7
  number_of_subprojects 0
@@ -12,24 +12,24 @@ FactoryGirl.define do
12
12
  end
13
13
  # name 'Test project'
14
14
  sequence(:name){ |n| "Project ##{n}" }
15
- identifier { name.parameterize }
15
+ sequence(:identifier){ |n| "#{name.parameterize}#{n}" }
16
16
 
17
17
  after(:create) do |project, evaluator|
18
18
  trackers = Array.wrap(evaluator.trackers)
19
19
  trackers = Tracker.all.to_a if trackers.empty?
20
- trackers.concat( [FactoryGirl.create(:tracker), FactoryGirl.create(:bug_tracker)] ) if evaluator.create_trackers || trackers.empty?
20
+ trackers.concat( [FactoryBot.create(:tracker), FactoryBot.create(:bug_tracker)] ) if evaluator.create_trackers || trackers.empty?
21
21
  project.trackers = trackers
22
- project.time_entry_activities = [FactoryGirl.create(:time_entry_activity)]
22
+ project.time_entry_activities = [FactoryBot.create(:time_entry_activity)]
23
23
  end
24
24
  after :create do |project, evaluator|
25
- FactoryGirl.create_list :issue, evaluator.number_of_issues, :project => project
26
- FactoryGirl.create_list :member, evaluator.number_of_members, :project => project, :roles => [FactoryGirl.create(:role)]
25
+ FactoryBot.create_list :issue, evaluator.number_of_issues, :project => project
26
+ FactoryBot.create_list :member, evaluator.number_of_members, :project => project, :roles => [FactoryBot.create(:role)]
27
27
  project.enabled_module_names += evaluator.add_modules
28
28
  end
29
29
 
30
30
  after :create do |project, evaluator|
31
31
  evaluator.members.each do |user|
32
- FactoryGirl.create(:member, project: project, user: user)
32
+ FactoryBot.create(:member, project: project, user: user)
33
33
  end
34
34
  end
35
35
 
@@ -39,19 +39,19 @@ FactoryGirl.define do
39
39
  milestone_options Hash.new
40
40
  end
41
41
  after :create do |project, evaluator|
42
- FactoryGirl.create_list :version, evaluator.number_of_versions, evaluator.milestone_options.merge( :project => project )
42
+ FactoryBot.create_list :version, evaluator.number_of_versions, evaluator.milestone_options.merge( :project => project )
43
43
  end
44
44
  end
45
45
 
46
46
  trait :with_subprojects do
47
47
  after :create do |project, evaluator|
48
- FactoryGirl.create_list :project, evaluator.number_of_subprojects, :parent => project
48
+ FactoryBot.create_list :project, evaluator.number_of_subprojects, :parent => project
49
49
  end
50
50
  end
51
51
 
52
52
  trait :with_categories do
53
53
  after :create do |project, evaluator|
54
- FactoryGirl.create_list :issue_category, evaluator.number_of_issue_categories, :project => project
54
+ FactoryBot.create_list :issue_category, evaluator.number_of_issue_categories, :project => project
55
55
  end
56
56
  end
57
57
  end
@@ -71,7 +71,7 @@ FactoryGirl.define do
71
71
  user
72
72
 
73
73
  after :build do |member, evaluator|
74
- member.member_roles << FactoryGirl.build(:member_role, member: member)
74
+ member.member_roles << FactoryBot.build(:member_role, member: member)
75
75
  end
76
76
 
77
77
  trait :without_roles do
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
 
3
3
  factory :time_entry_activity, :parent => :enumeration, :class => 'TimeEntryActivity' do
4
4
  name 'TestActivity'
@@ -1,9 +1,9 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
 
3
3
  factory :tracker do
4
4
  sequence(:name) {|n| "Feature ##{n}"}
5
5
 
6
- default_status { IssueStatus.first || FactoryGirl.create(:issue_status) }
6
+ default_status { IssueStatus.first || FactoryBot.create(:issue_status) }
7
7
 
8
8
  trait :bug do
9
9
  sequence(:name) {|n| "Bug ##{n}"}
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :user do
3
3
  firstname 'John'
4
4
  sequence(:lastname) {|n| 'Doe' + n.to_s }
@@ -2,7 +2,7 @@ require 'rails_helper'
2
2
 
3
3
  RSpec.describe EasySetting, type: :model do
4
4
 
5
- let(:project) { FactoryGirl.create(:project, name: 'My project') }
5
+ let(:project) { FactoryBot.create(:project, name: 'My project') }
6
6
  let!(:easy_setting) { EasySetting.create(name: 'my_setting', value: 'my_value', project_id: project.id) }
7
7
  let!(:easy_setting_global) { EasySetting.create(name: 'my_setting', value: 'my_value_global') }
8
8
 
@@ -1,20 +1,20 @@
1
1
  require 'rails_helper'
2
2
 
3
- module RedmineExtensions
4
- RSpec.describe EasySettingPresenter, clear_cache: true do
3
+ module EasySettings
4
+ RSpec.describe ParamsWrapper, clear_cache: true do
5
5
 
6
- let(:project) { FactoryGirl.create(:project) }
6
+ let(:project) { FactoryBot.create(:project) }
7
7
 
8
8
  describe 'saving values' do
9
9
  it 'create easy_setting' do
10
- presenter = EasySettingPresenter.new({'key' => 'value', 'key2' => 'value2'})
10
+ presenter = EasySettings::ParamsWrapper.from_params({'key' => 'value', 'key2' => 'value2'})
11
11
  expect{ presenter.save }.to change(EasySetting, :count).by(2)
12
12
  expect( EasySetting.find_by(name: 'key').value ).to eq('value')
13
13
  expect( EasySetting.value('key') ).to eq('value')
14
14
  end
15
15
 
16
16
  it 'create project setting' do
17
- presenter = EasySettingPresenter.new({'key' => 'value', 'key2' => 'value2'}, project)
17
+ presenter = EasySettings::ParamsWrapper.from_params({'key' => 'value', 'key2' => 'value2'}, project: project)
18
18
  expect{ presenter.save }.to change(EasySetting, :count).by(2)
19
19
  expect( EasySetting.where(project_id: project.id).count ).to eq(2)
20
20
  expect( EasySetting.value('key') ).to eq(nil)
@@ -22,8 +22,8 @@ module RedmineExtensions
22
22
  end
23
23
 
24
24
  it 'format value' do
25
- presenter = EasySettingPresenter.new({'key' => '1', 'key2' => '0'})
26
- expect(presenter).to receive(:boolean_keys).at_least(:once).and_return([:key, :key2])
25
+ EasySetting.map.boolean_keys(:key, :key2)
26
+ presenter = EasySettings::ParamsWrapper.from_params({'key' => '1', 'key2' => '0'})
27
27
  presenter.save
28
28
  expect(EasySetting.value('key')).to be true
29
29
  expect(EasySetting.value('key2')).to be false
data/spec/rails_helper.rb CHANGED
@@ -5,7 +5,7 @@ require 'spec_helper'
5
5
  require File.expand_path("../redmine/config/environment.rb", __FILE__)
6
6
  # Add additional requires below this line. Rails is not loaded until this point!
7
7
  require 'rspec/rails'
8
- require 'factory_girl_rails'
8
+ require 'factory_bot_rails'
9
9
  require 'database_cleaner'
10
10
 
11
11
  Rails.backtrace_cleaner.remove_silencers!
@@ -63,7 +63,13 @@ Capybara.register_driver :poltergeist do |app|
63
63
  end
64
64
 
65
65
  Capybara.register_driver :chrome do |app|
66
- Capybara::Selenium::Driver.new(app, :browser => :chrome)
66
+ capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
67
+ 'chromeOptions' => {
68
+ 'args' => ENV['CHROME_OPTIONS'].to_s.split(' ')
69
+ }
70
+ )
71
+
72
+ Capybara::Selenium::Driver.new(app, browser: :chrome, desired_capabilities: capabilities)
67
73
  end
68
74
 
69
75
  Capybara.javascript_driver = ENV['JS_DRIVER'].present? ? ENV['JS_DRIVER'].downcase.to_sym : :poltergeist
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine_extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Easy Software Ltd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-29 00:00:00.000000000 Z
11
+ date: 2018-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -84,16 +84,16 @@ dependencies:
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: '2.6'
87
+ version: 3.3.1
88
88
  type: :development
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
92
  - - "~>"
93
93
  - !ruby/object:Gem::Version
94
- version: '2.6'
94
+ version: 3.3.1
95
95
  - !ruby/object:Gem::Dependency
96
- name: factory_girl_rails
96
+ name: factory_bot_rails
97
97
  requirement: !ruby/object:Gem::Requirement
98
98
  requirements:
99
99
  - - "~>"
@@ -280,7 +280,7 @@ files:
280
280
  - spec/factories/users.rb
281
281
  - spec/features/autocomplete_spec.rb
282
282
  - spec/models/easy_setting_spec.rb
283
- - spec/presenters/redmine_extensions/easy_setting_presenter_spec.rb
283
+ - spec/presenters/easy_settings/params_wrapper_spec.rb
284
284
  - spec/rails_helper.rb
285
285
  - spec/spec_helper.rb
286
286
  - spec/support/plugin_generator.rb
@@ -319,7 +319,7 @@ test_files:
319
319
  - spec/factories/users.rb
320
320
  - spec/features/autocomplete_spec.rb
321
321
  - spec/models/easy_setting_spec.rb
322
- - spec/presenters/redmine_extensions/easy_setting_presenter_spec.rb
322
+ - spec/presenters/easy_settings/params_wrapper_spec.rb
323
323
  - spec/rails_helper.rb
324
324
  - spec/spec_helper.rb
325
325
  - spec/support/plugin_generator.rb