@@ -46,9 +46,9 | |||
|
46 | 46 | <% end %> |
|
47 | 47 | |
|
48 | 48 | <% other_formats_links do |f| %> |
|
49 | <%= f.link_to 'Atom', :url => {:query_id => (@query.new_record? ? nil : @query), :key => User.current.rss_key} %> | |
|
50 | <%= f.link_to 'CSV' %> | |
|
51 | <%= f.link_to 'PDF' %> | |
|
49 | <%= f.link_to 'Atom', :url => { :project_id => @project, :query_id => (@query.new_record? ? nil : @query), :key => User.current.rss_key } %> | |
|
50 | <%= f.link_to 'CSV', :url => { :project_id => @project } %> | |
|
51 | <%= f.link_to 'PDF', :url => { :project_id => @project } %> | |
|
52 | 52 | <% end %> |
|
53 | 53 | |
|
54 | 54 | <% end %> |
@@ -88,5 +88,42 class IssuesTest < ActionController::IntegrationTest | |||
|
88 | 88 | Issue.find(1).attachments.each(&:destroy) |
|
89 | 89 | assert_equal 0, Issue.find(1).attachments.length |
|
90 | 90 | end |
|
91 | ||
|
91 | ||
|
92 | def test_other_formats_links_on_get_index | |
|
93 | get '/projects/ecookbook/issues' | |
|
94 | ||
|
95 | %w(Atom PDF CSV).each do |format| | |
|
96 | assert_tag :a, :content => format, | |
|
97 | :attributes => { :href => "/projects/ecookbook/issues.#{format.downcase}", | |
|
98 | :rel => 'nofollow' } | |
|
99 | end | |
|
100 | end | |
|
101 | ||
|
102 | def test_other_formats_links_on_post_index_without_project_id_in_url | |
|
103 | post '/issues', :project_id => 'ecookbook' | |
|
104 | ||
|
105 | %w(Atom PDF CSV).each do |format| | |
|
106 | assert_tag :a, :content => format, | |
|
107 | :attributes => { :href => "/projects/ecookbook/issues.#{format.downcase}", | |
|
108 | :rel => 'nofollow' } | |
|
109 | end | |
|
110 | end | |
|
111 | ||
|
112 | def test_pagination_links_on_get_index | |
|
113 | Setting.per_page_options = '2' | |
|
114 | get '/projects/ecookbook/issues' | |
|
115 | ||
|
116 | assert_tag :a, :content => '2', | |
|
117 | :attributes => { :href => '/projects/ecookbook/issues?page=2' } | |
|
118 | ||
|
119 | end | |
|
120 | ||
|
121 | def test_pagination_links_on_post_index_without_project_id_in_url | |
|
122 | Setting.per_page_options = '2' | |
|
123 | post '/issues', :project_id => 'ecookbook' | |
|
124 | ||
|
125 | assert_tag :a, :content => '2', | |
|
126 | :attributes => { :href => '/projects/ecookbook/issues?page=2' } | |
|
127 | ||
|
128 | end | |
|
92 | 129 | end |
General Comments 0
You need to be logged in to leave comments.
Login now