To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / test / functional / activities_controller_test.rb @ 442:753f1380d6bc

History | View | Annotate | Download (2.6 KB)

1 119:8661b858af72 Chris
require File.expand_path('../../test_helper', __FILE__)
2 22:40f7cfd4df19 chris
3
class ActivitiesControllerTest < ActionController::TestCase
4
  fixtures :all
5
6
  def test_project_index
7
    get :index, :id => 1, :with_subprojects => 0
8
    assert_response :success
9
    assert_template 'index'
10
    assert_not_nil assigns(:events_by_day)
11 441:cbce1fd3b1b7 Chris
12
    assert_tag :tag => "h3",
13 22:40f7cfd4df19 chris
               :content => /#{2.days.ago.to_date.day}/,
14
               :sibling => { :tag => "dl",
15
                 :child => { :tag => "dt",
16
                   :attributes => { :class => /issue-edit/ },
17
                   :child => { :tag => "a",
18
                     :content => /(#{IssueStatus.find(2).name})/,
19
                   }
20
                 }
21
               }
22
  end
23 441:cbce1fd3b1b7 Chris
24 22:40f7cfd4df19 chris
  def test_previous_project_index
25
    get :index, :id => 1, :from => 3.days.ago.to_date
26
    assert_response :success
27
    assert_template 'index'
28
    assert_not_nil assigns(:events_by_day)
29 441:cbce1fd3b1b7 Chris
30
    assert_tag :tag => "h3",
31 22:40f7cfd4df19 chris
               :content => /#{3.day.ago.to_date.day}/,
32
               :sibling => { :tag => "dl",
33
                 :child => { :tag => "dt",
34
                   :attributes => { :class => /issue/ },
35
                   :child => { :tag => "a",
36
                     :content => /#{Issue.find(1).subject}/,
37
                   }
38
                 }
39
               }
40
  end
41 441:cbce1fd3b1b7 Chris
42 22:40f7cfd4df19 chris
  def test_global_index
43
    get :index
44
    assert_response :success
45
    assert_template 'index'
46
    assert_not_nil assigns(:events_by_day)
47 441:cbce1fd3b1b7 Chris
48
    assert_tag :tag => "h3",
49 22:40f7cfd4df19 chris
               :content => /#{5.day.ago.to_date.day}/,
50
               :sibling => { :tag => "dl",
51
                 :child => { :tag => "dt",
52
                   :attributes => { :class => /issue/ },
53
                   :child => { :tag => "a",
54
                     :content => /#{Issue.find(5).subject}/,
55
                   }
56
                 }
57
               }
58
  end
59 441:cbce1fd3b1b7 Chris
60 22:40f7cfd4df19 chris
  def test_user_index
61
    get :index, :user_id => 2
62
    assert_response :success
63
    assert_template 'index'
64
    assert_not_nil assigns(:events_by_day)
65 441:cbce1fd3b1b7 Chris
66
    assert_tag :tag => "h3",
67 22:40f7cfd4df19 chris
               :content => /#{3.day.ago.to_date.day}/,
68
               :sibling => { :tag => "dl",
69
                 :child => { :tag => "dt",
70
                   :attributes => { :class => /issue/ },
71
                   :child => { :tag => "a",
72
                     :content => /#{Issue.find(1).subject}/,
73
                   }
74
                 }
75
               }
76
  end
77 441:cbce1fd3b1b7 Chris
78 22:40f7cfd4df19 chris
  def test_index_atom_feed
79
    get :index, :format => 'atom'
80
    assert_response :success
81
    assert_template 'common/feed.atom.rxml'
82
    assert_tag :tag => 'entry', :child => {
83
      :tag => 'link',
84
      :attributes => {:href => 'http://test.host/issues/11'}}
85
  end
86
end