assert_not_nil assigns(:entries)
assert_not_nil assigns(:changesets)
end
-
+
def test_browse_root
@repository.fetch_changesets
@repository.reload
entry = assigns(:entries).detect {|e| e.name == 'subversion_test'}
assert_equal 'dir', entry.kind
end
-
+
def test_browse_directory
@repository.fetch_changesets
@repository.reload
assert_response :success
assert_template 'show'
assert_not_nil assigns(:entries)
- assert_equal ['[folder_with_brackets]', 'folder', '.project', 'helloworld.c', 'textfile.txt'], assigns(:entries).collect(&:name)
+ assert_equal ['[folder_with_brackets]', 'folder', '.project', 'helloworld.c', 'textfile.txt'],
+ assigns(:entries).collect(&:name)
entry = assigns(:entries).detect {|e| e.name == 'helloworld.c'}
assert_equal 'file', entry.kind
assert_equal 'subversion_test/helloworld.c', entry.path
assert_response :success
assert_template 'show'
assert_not_nil assigns(:entries)
- assert_equal ['folder', '.project', 'helloworld.c', 'helloworld.rb', 'textfile.txt'], assigns(:entries).collect(&:name)
+ assert_equal ['folder', '.project', 'helloworld.c', 'helloworld.rb', 'textfile.txt'],
+ assigns(:entries).collect(&:name)
end
-
+
def test_file_changes
@repository.fetch_changesets
@repository.reload
get :changes, :id => PRJ_ID, :path => ['subversion_test', 'folder' ]
assert_response :success
assert_template 'changes'
-
+
changesets = assigns(:changesets)
assert_not_nil changesets
assert_equal %w(10 9 7 6 5 2), changesets.collect(&:revision)
end
-
+
def test_entry
@repository.fetch_changesets
@repository.reload
assert_response :success
assert_template 'entry'
end
-
+
def test_entry_should_send_if_too_big
@repository.fetch_changesets
@repository.reload
assert_equal 'attachment; filename="helloworld.c"', @response.headers['Content-Disposition']
end
end
-
+
def test_entry_at_given_revision
@repository.fetch_changesets
@repository.reload
assert_tag :tag => 'td', :attributes => { :class => /line-code/},
:content => /Here's the code/
end
-
+
def test_entry_not_found
@repository.fetch_changesets
@repository.reload
assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
:content => /The entry or revision was not found in the repository/
end
-
+
def test_entry_download
@repository.fetch_changesets
@repository.reload
assert_template ''
assert_equal 'attachment; filename="helloworld.c"', @response.headers['Content-Disposition']
end
-
+
def test_directory_entry
@repository.fetch_changesets
@repository.reload
assert_not_nil assigns(:entry)
assert_equal 'folder', assigns(:entry).name
end
-
+
# TODO: this test needs fixtures.
def test_revision
@repository.fetch_changesets
}
}
end
-
+
def test_invalid_revision
@repository.fetch_changesets
@repository.reload
r = Project.find(1).repository
# Changes repository url to a subdirectory
r.update_attribute :url, (r.url + '/test/some')
-
+
get :revision, :id => 1, :rev => 2
assert_response :success
assert_template 'revision'
}
}
end
-
+
def test_revision_diff
@repository.fetch_changesets
@repository.reload
get :diff, :id => PRJ_ID, :rev => 6, :rev_to => 2, :path => ['subversion_test', 'folder']
assert_response :success
assert_template 'diff'
-
+
diff = assigns(:diff)
assert_not_nil diff
# 2 files modified
assert_tag :tag => 'h2', :content => /2:6/
end
-
+
def test_annotate
@repository.fetch_changesets
@repository.reload