Project

General

Profile

Feature #34025 » 34025.diff

Go MAEDA, 2022-03-23 03:17

View differences:

app/views/common/feed.atom.builder (作業コピー)
2 2

  
3 3
xml.instruct!
4 4
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
5
  xml.title   truncate_single_line_raw(@title, 100)
5
  xml.title   @title
6 6
  xml.link    "rel" => "self", "href" => url_for(:params => request.query_parameters, :only_path => false, :format => 'atom')
7 7
  xml.link    "rel" => "alternate", "href" => url_for(:params => request.query_parameters.merge(:format => nil, :key => nil), :only_path => false)
8 8
  xml.id      home_url
......
14 14
    xml.entry do
15 15
      url = url_for(item.event_url(:only_path => false))
16 16
      if @project == item.project
17
        xml.title truncate_single_line_raw(item.event_title, 100)
17
        xml.title item.event_title
18 18
      else
19
        xml.title truncate_single_line_raw("#{item.project} - #{item.event_title}", 100)
19
        xml.title "#{item.project} - #{item.event_title}"
20 20
      end
21 21
      xml.link "rel" => "alternate", "href" => url
22 22
      xml.id url
test/functional/activities_controller_test.rb (作業コピー)
227 227
    end
228 228
  end
229 229

  
230
  def test_index_atom_feed_should_not_truncate_subject
231
    long_subject = Array.new(255) {('a'..'z').to_a.sample}.join
232
    Issue.find(5).update_attribute(:subject, long_subject)
233

  
234
    get(
235
      :index,
236
      :params => {
237
        :format => 'atom',
238
        :id => 'ecookbook',
239
        :with_subprojects => 1,
240
        :show_issues => 1
241
      }
242
    )
243
    assert_response :success
244

  
245
    assert_select 'feed' do
246
      assert_select 'title', text: "eCookbook Subproject 1 - Bug #5 (New): #{long_subject}"
247
    end
248
  end
249

  
230 250
  def test_index_should_show_private_notes_with_permission_only
231 251
    journal = Journal.create!(:journalized => Issue.find(2), :notes => 'Private notes', :private_notes => true)
232 252
    @request.session[:user_id] = 2
    (1-1/1)