28 |
28 |
:members,
|
29 |
29 |
:groups_users,
|
30 |
30 |
:enabled_modules,
|
31 |
|
:journals, :journal_details
|
|
31 |
:journals, :journal_details,
|
|
32 |
:repositories, :changesets, :changes
|
32 |
33 |
|
33 |
34 |
def test_project_index
|
34 |
35 |
get(
|
... | ... | |
266 |
267 |
assert_select '.pagination a', :text => /Previous/
|
267 |
268 |
assert_select '.pagination a', :text => /Next/
|
268 |
269 |
end
|
|
270 |
|
|
271 |
def test_index_with_git_changesets_and_gravatar_enabled_should_display_gravatar
|
|
272 |
project = Project.find(1)
|
|
273 |
project.repositories.delete_all
|
|
274 |
repo = Repository::Git.create!(
|
|
275 |
:project => project,
|
|
276 |
:url => Rails.root.join('tmp/test/git_repository').to_s
|
|
277 |
)
|
|
278 |
repo.fetch_changesets
|
|
279 |
rev = '2a682156a3b6e77a8bf9cd4590e8db757f3c6c78'
|
|
280 |
changeset = repo.find_changeset_by_name(rev)
|
|
281 |
assert_equal 'test20120208 <none@none>', changeset.committer
|
|
282 |
|
|
283 |
@request.session[:user_id] = 1
|
|
284 |
User.current = User.find(1)
|
|
285 |
from_date = User.current.time_to_date(changeset.committed_on).to_s
|
|
286 |
|
|
287 |
[['1', 1], ['0', 0]].each do |(gravatar_enabled, img_count)|
|
|
288 |
with_settings :gravatar_enabled => gravatar_enabled do
|
|
289 |
get(
|
|
290 |
:index,
|
|
291 |
:params => {
|
|
292 |
:id => project.id,
|
|
293 |
:show_changesets => 1,
|
|
294 |
:from => from_date
|
|
295 |
}
|
|
296 |
)
|
|
297 |
assert_response :success
|
|
298 |
assert_select 'dt.changeset:first-child' do
|
|
299 |
assert_select 'a[href=?]', "/projects/ecookbook/repository/#{repo.id}/revisions/#{rev}"
|
|
300 |
assert_select 'img.gravatar', img_count
|
|
301 |
end
|
|
302 |
end
|
|
303 |
end
|
|
304 |
end
|
|
305 |
|
|
306 |
def test_index_with_mercurial_changesets_and_gravatar_enabled_should_display_gravatar
|
|
307 |
project = Project.find(1)
|
|
308 |
project.repositories.delete_all
|
|
309 |
repo = Repository::Mercurial.create!(
|
|
310 |
:project => project,
|
|
311 |
:url => Rails.root.join('tmp/test/mercurial_repository').to_s
|
|
312 |
)
|
|
313 |
repo.fetch_changesets
|
|
314 |
rev = 'afc61e85bde74de930e5846c8451bd55b5bafc9c'
|
|
315 |
changeset = repo.find_changeset_by_name(rev)
|
|
316 |
assert_equal 'test Ü <test00@foo.bar>', changeset.committer
|
|
317 |
|
|
318 |
@request.session[:user_id] = 1
|
|
319 |
User.current = User.find(1)
|
|
320 |
from_date = User.current.time_to_date(changeset.committed_on).to_s
|
|
321 |
|
|
322 |
[['1', 1], ['0', 0]].each do |(gravatar_enabled, img_count)|
|
|
323 |
with_settings :gravatar_enabled => gravatar_enabled do
|
|
324 |
get(
|
|
325 |
:index,
|
|
326 |
:params => {
|
|
327 |
:id => project.id,
|
|
328 |
:show_changesets => 1,
|
|
329 |
:from => from_date
|
|
330 |
}
|
|
331 |
)
|
|
332 |
assert_response :success
|
|
333 |
assert_select 'dt.changeset:first-child' do
|
|
334 |
assert_select 'a[href=?]', "/projects/ecookbook/repository/#{repo.id}/revisions/#{rev}"
|
|
335 |
assert_select 'img.gravatar', img_count
|
|
336 |
end
|
|
337 |
end
|
|
338 |
end
|
|
339 |
end
|
269 |
340 |
end
|