Browse files

Fix deprecation warnings for test:functionals, prepare for http sync.

  • Loading branch information...
1 parent 8e8d2bc commit 2d443a7f7bd52b74011d6bea3c6208beb0b35e77 @pwnall committed Jun 30, 2012
View
2 .gitignore
@@ -7,7 +7,7 @@ tmp
.DS_Store
*~
*.rbc
-*.swp
+*.sw*
doc/controllers_brief.svg
doc/controllers_complete.svg
View
6 .vimrc
@@ -0,0 +1,6 @@
+" Indentation settings for the project: 2-space indentation, no tabs.
+set tabstop=2
+set softtabstop=2
+set shiftwidth=2
+set expandtab
+
View
2 Gemfile
@@ -32,7 +32,7 @@ gem 'jquery-rails', '>= 2.0.0'
gem 'authpwn_rails', '>= 0.10.9'
gem 'configvars_rails', '>= 0.5.2'
gem 'gravatar-ultimate', '>= 1.0.3'
-gem 'grit', :git => 'git://github.com/pwnall/grit.git', :branch => 'hunks'
+gem 'grit', :git => 'https://github.com/pwnall/grit.git', :branch => 'hunks'
gem 'json', :platforms => [:mri_18, :jruby]
gem 'markdpwn', '>= 0.1.2'
gem 'net-ssh', '>= 2.3.0', :require => 'net/ssh'
View
2 Gemfile.lock
@@ -1,5 +1,5 @@
GIT
- remote: git://github.com/pwnall/grit.git
+ remote: https://github.com/pwnall/grit.git
revision: 5e7a554c2aac8c77ae02ff81b71f164a2640605e
branch: hunks
specs:
View
5 app/models/repository.rb
@@ -39,6 +39,11 @@ def profile_name=(new_profile_name)
validates :name, :length => 1..64, :format => /\A\w([\w.-]*\w)?\Z/,
:presence => true,
:uniqueness => { :scope => :profile_id }
+ validates_each :name do |record, attr, value|
+ if /\.git$/ =~ value
+ record.errors.add attr, "Don't use .git in the repository name."
+ end
+ end
attr_accessible :name
# Usually a blog post introducing the repository's contents, or a development site.
View
11 app/views/issues/_issue.html.erb
@@ -13,14 +13,11 @@
<% if issue.can_edit? current_user %>
<p>
<%= link_to 'Edit', edit_profile_repository_issue_path(
- issue.repository.profile,
- issue.repository, issue),
- method: :get %>
+ issue.repository.profile, issue.repository, issue),
+ :method => :get %>
<%= link_to 'Delete', profile_repository_issue_path(
- issue.repository.profile,
- issue.repository, issue),
- confirm: 'Are you sure?',
- method: :delete %>
+ issue.repository.profile, issue.repository, issue),
+ :method => :delete, :data => { :confirm => 'Are you sure?' } %>
</p>
<% end %>
</div>
View
2 app/views/issues/_issue_show.html.erb
@@ -17,7 +17,7 @@
:method => :get %>
<%= link_to 'Delete', profile_repository_issue_path(
issue.repository.profile, issue.repository, issue),
- :confirm => 'Are you sure?', :method => :delete %>
+ :method => :delete, :data => { :confirm => 'Are you sure?' } %>
</p>
<p>
<% if issue.open %>
View
5 app/views/profiles/index.html.erb
@@ -13,7 +13,10 @@
<td><%= profile.name %></td>
<td><%= link_to 'Show', profile %></td>
<td><%= link_to 'Edit', edit_profile_path(profile) %></td>
- <td><%= link_to 'Destroy', profile, :confirm => 'Are you sure?', :method => :delete %></td>
+ <td>
+ <%= link_to 'Destroy', profile, :method => :delete, :data => {
+ :confirm => 'Are you sure?' } %>
+ </td>
</tr>
<% end %>
</table>
View
4 app/views/repositories/_list.html.erb
@@ -8,8 +8,8 @@
<ul class="actions">
<li>
<%= link_to 'Delete', [repository.profile, repository],
- :method => :delete,
- :confirm => "This will permanently delete all the information in the #{repository.name} repository." %>
+ :method => :delete, :data => {
+ :confirm => "This will permanently delete all the information in the #{repository.name} repository." } %>
</li>
</ul>
View
5 app/views/users/index.html.erb
@@ -13,7 +13,10 @@
<td><%= user.email %></td>
<td><%= link_to 'Show', user %></td>
<td><%= link_to 'Edit', edit_user_path(user) %></td>
- <td><%= link_to 'Destroy', user, :confirm => 'Are you sure?', :method => :delete %></td>
+ <td>
+ <%= link_to 'Destroy', user, :method => :delete, :data =>
+ { :confirm => 'Are you sure?' } %>
+ </td>
</tr>
<% end %>
</table>
View
6 test/integration/git_push_test.rb
@@ -48,7 +48,11 @@ def setup
@fixture_repo_path = Rails.root.join 'test', 'fixtures', 'repo.git'
- # Wait until the Rails server has booted.
+ wait_for_server_start
+ end
+
+ # Wait until the Rails server has booted.
+ def wait_for_server_start
deadline = Time.now + 30.seconds
loop do
begin
View
5 test/unit/repository_test.rb
@@ -25,14 +25,15 @@ class RepositoryTest < ActiveSupport::TestCase
test 'no funky names' do
['$awesome', 'space name', 'quo"te', "more'quote", '-flag',
- 'loose-', '.hidden', 'confused.'].each do |name|
+ 'loose-', '.hidden', 'confused.', 'awesome.git'].each do |name|
@repo.name = name
assert !@repo.valid?
end
end
test 'valid names' do
- ['awesome', 'great-idea', 'great.idea', "CamelCased"].each do |name|
+ ['awesome', 'great-idea', 'great.idea', 'CamelCased',
+ 'awesome.gi'].each do |name|
@repo.name = name
assert @repo.valid?
end

0 comments on commit 2d443a7

Please sign in to comment.