Project

General

Profile

Defect #4935 » 4935.diff

Jan from Planio www.plan.io, 2010-06-20 15:09

View differences:

app/views/projects/index.rhtml
5 5
<div class="contextual">
6 6
    <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'add'}, :class => 'icon icon-add') + ' |' if User.current.allowed_to?(:add_project, nil, :global => true) %>
7 7
    <%= link_to(l(:label_issue_view_all), { :controller => 'issues' }) + ' |' if User.current.allowed_to?(:view_issues, nil, :global => true) %>
8
    <%= link_to(l(:label_overall_spent_time), { :controller => 'time_entries' }) + ' |' if User.current.allowed_to?(:view_time_entries, nil, :global => true) %>
8 9
    <%= link_to l(:label_overall_activity), { :controller => 'projects', :action => 'activity' }%>
9 10
</div>
10 11

  
config/locales/de.yml
646 646
  label_changes_details: Details aller Ă„nderungen
647 647
  label_issue_tracking: Tickets
648 648
  label_spent_time: Aufgewendete Zeit
649
  label_overall_spent_time: Aufgewendete Zeit aller Projekte anzeigen
649 650
  label_f_hour: "{{value}} Stunde"
650 651
  label_f_hour_plural: "{{value}} Stunden"
651 652
  label_time_tracking: Zeiterfassung
config/locales/en.yml
638 638
  label_changes_details: Details of all changes
639 639
  label_issue_tracking: Issue tracking
640 640
  label_spent_time: Spent time
641
  label_overall_spent_time: Overall spent time
641 642
  label_f_hour: "{{value}} hour"
642 643
  label_f_hour_plural: "{{value}} hours"
643 644
  label_time_tracking: Time tracking
test/functional/projects_controller_test.rb
60 60
    assert_select 'feed>entry', :count => Project.count(:conditions => Project.visible_by(User.current))
61 61
  end
62 62
  
63
  context "#index" do
64
    context "by non-admin user with view_time_entries permission" do
65
      setup do
66
        @request.session[:user_id] = 3
67
      end
68
      should "show overall spent time link" do
69
        get :index
70
        assert_template 'index'
71
        assert_tag :a, :attributes => {:href => '/time_entries'}
72
      end
73
    end
74
    
75
    context "by non-admin user without view_time_entries permission" do
76
      setup do
77
        Role.find(2).remove_permission! :view_time_entries
78
        Role.non_member.remove_permission! :view_time_entries
79
        Role.anonymous.remove_permission! :view_time_entries
80
        @request.session[:user_id] = 3
81
      end
82
      should "not show overall spent time link" do
83
        get :index
84
        assert_template 'index'
85
        assert_no_tag :a, :attributes => {:href => '/time_entries'}
86
      end
87
    end 
88
  end
89
  
63 90
  context "#add" do
64 91
    context "by admin user" do
65 92
      setup do
    (1-1/1)