pull/4862/head
Jens Ulferts 8 years ago
parent ef7153543e
commit e8dec71010
No known key found for this signature in database
GPG Key ID: 3CAA4B1182CF5308
  1. 2
      app/views/homescreen/blocks/_administration.html.erb
  2. 2
      app/views/projects/destroy_info.html.erb
  3. 2
      config/routes.rb
  4. 4
      spec/features/menu_items/admin_menu_item_spec.rb
  5. 6
      spec/features/projects/projects_spec.rb
  6. 9
      spec/models/custom_value_spec.rb
  7. 1
      spec/requests/api/v3/authentication_spec.rb
  8. 4
      spec_legacy/functional/project_enumerations_controller_spec.rb

@ -5,7 +5,7 @@
<ul class="widget-box--arrow-links">
<li>
<%= link_to l(:label_project_plural), admin_projects_path,
<%= link_to l(:label_project_plural), projects_admin_index_path,
title: l(:label_project_plural) %>
</li>
<li>

@ -54,7 +54,7 @@ See doc/COPYRIGHT.rdoc for more details.
concat content_tag :i, '', class: 'button--icon icon-delete'
concat content_tag :span, l(:button_delete), class: 'button--text'
end %>
<%= link_to admin_projects_path,
<%= link_to projects_admin_index_path,
title: l(:button_cancel),
class: 'button -with-icon icon-cancel' do %>
<%= l(:button_cancel) %>

@ -459,7 +459,7 @@ OpenProject::Application.routes.draw do
only: [:show]
end
resources :time_entries, controller: 'timelog', only: :index
resources :time_entries, controller: 'timelog'
resources :activity, :activities, only: :index, controller: 'activities'

@ -41,7 +41,7 @@ feature 'Admin menu items' do
describe 'displaying all the menu items' do
it 'hides the specified admin menu items' do
visit admin_path
visit admin_index_path
expect(page).to have_selector('a', text: I18n.t('label_user_plural'))
expect(page).to have_selector('a', text: I18n.t('label_project_plural'))
@ -56,7 +56,7 @@ feature 'Admin menu items' do
end
it 'hides the specified admin menu items' do
visit admin_path
visit admin_index_path
expect(page).to have_selector('a', text: I18n.t('label_user_plural'))
expect(page).to have_selector('a', text: I18n.t('label_project_plural'))

@ -40,7 +40,7 @@ describe 'Projects', type: :feature do
let!(:project) { FactoryGirl.create(:project, name: 'Foo project', identifier: 'foo-project') }
before do
visit admin_path
visit admin_index_path
end
it 'can create a project' do
@ -102,7 +102,7 @@ describe 'Projects', type: :feature do
let!(:project) { FactoryGirl.create(:project, name: 'Foo project', types: [phase_type, milestone_type]) }
it "have the correct types checked for the project's types" do
visit admin_path
visit admin_index_path
click_on 'Foo project'
click_on 'Types'
@ -146,7 +146,7 @@ describe 'Projects', type: :feature do
let!(:project) { FactoryGirl.create(:project, identifier: 'foo') }
it 'updates the project identifier' do
visit admin_path
visit admin_index_path
click_on project.name
click_on 'Edit'

@ -93,17 +93,12 @@ describe CustomValue do
end
describe 'storing to db' do
let(:db_entry) do
sql = "SELECT value from custom_values where custom_values.id = #{custom_value.id}"
ActiveRecord::Base.connection.execute(sql)
end
context 'for a boolean custom field' do
context 'for the integer 1' do
let(:value) { 1 }
it "is saved as 't'" do
expect(db_entry.first['value']).to eql 't'
expect(custom_value.value).to eql 't'
end
end
@ -111,7 +106,7 @@ describe CustomValue do
let(:value) { 0 }
it "is saved as 'f'" do
expect(db_entry.first['value']).to eql 'f'
expect(custom_value.value).to eql 'f'
end
end
end

@ -35,7 +35,6 @@ describe API::V3, type: :request do
let(:response_401) do
{
'_embedded' => {},
'_type' => 'Error',
'errorIdentifier' => 'urn:openproject-org:api:v3:errors:Unauthenticated',
'message' => expected_message

@ -71,7 +71,7 @@ describe ProjectEnumerationsController, type: :controller do
refute_equal development.parent.id, development.id # Different records
assert_equal development.parent.name, development.name # Same name
assert development.active?
assert_equal '0', development.custom_value_for(billable_field).value
assert_equal 'f', development.custom_value_for(billable_field).value
# ... Inactive Activity
previously_inactive = project.time_entry_activities.find_by(name: 'Inactive Activity')
@ -81,7 +81,7 @@ describe ProjectEnumerationsController, type: :controller do
refute_equal previously_inactive.parent.id, previously_inactive.id # Different records
assert_equal previously_inactive.parent.name, previously_inactive.name # Same name
assert previously_inactive.active?
assert_equal '1', previously_inactive.custom_value_for(billable_field).value
assert_equal 't', previously_inactive.custom_value_for(billable_field).value
# ... QA
assert_equal nil, project.time_entry_activities.find_by(name: 'QA'), "Custom QA activity created when it wasn't modified"

Loading…
Cancel
Save