Permalink
Browse files

Hash rockets everywhere!

  • Loading branch information...
1 parent bde2125 commit 170ca52632c58e52927028518f95a5f84d395cd2 @andrew andrew committed Dec 7, 2012
View
@@ -67,6 +67,6 @@ group :test do
gem "capybara"
gem 'database_cleaner'
gem 'shoulda-matchers'
- gem 'webmock', require: false
+ gem 'webmock', :require => false
gem 'poltergeist'
end
@@ -1,7 +1,7 @@
class ProjectsController < ApplicationController
before_filter :ensure_logged_in, :except => [:index]
respond_to :html
- respond_to :json, only: :index
+ respond_to :json, :only => :index
def index
@projects = Project.order(:name).all
@@ -1,9 +1,9 @@
class PullRequest < ActiveRecord::Base
attr_accessible :title, :issue_url, :body, :state, :merged, :created_at, :repo_name
- belongs_to :user, counter_cache: true
+ belongs_to :user, :counter_cache => true
- validates_uniqueness_of :issue_url, scope: :user_id
+ validates_uniqueness_of :issue_url, :scope => :user_id
after_create :post_tweet
@@ -31,7 +31,7 @@ def initialize_from_github(json)
end
def post_tweet
- user.twitter.update(I18n.t 'pull_request.twitter_message', issue_url: issue_url) if user && user.twitter_linked?
+ user.twitter.update(I18n.t 'pull_request.twitter_message', :issue_url => issue_url) if user && user.twitter_linked?
end
def gifted_state
View
@@ -124,10 +124,10 @@ def download_pull_requests
def twitter
@twitter ||= Twitter::Client.new(
- consumer_key: ENV['TWITTER_KEY'],
- consumer_secret: ENV['TWITTER_SECRET'],
- oauth_token: twitter_token,
- oauth_token_secret: twitter_secret
+ :consumer_key => ENV['TWITTER_KEY'],
+ :consumer_secret => ENV['TWITTER_SECRET'],
+ :oauth_token => twitter_token,
+ :oauth_token_secret => twitter_secret
)
end
View
@@ -10,17 +10,17 @@
resource :dashboard # Singular, only applies to current user
resource :pull_request_download, :only => :create
- match '/preferences', to: 'dashboards#preferences', as: 'preferences'
- match '/preferences/update', to: 'dashboards#update_preferences', as: 'update_preferences'
+ match '/preferences', :to => 'dashboards#preferences', :as => 'preferences'
+ match '/preferences/update', :to => 'dashboards#update_preferences', :as => 'update_preferences'
- match '/login', to: 'sessions#new', as: 'login'
- match '/logout', to: 'sessions#destroy', as: 'logout'
+ match '/login', :to => 'sessions#new', :as => 'login'
+ match '/logout', :to => 'sessions#destroy', :as => 'logout'
- match '/auth/twitter/callback', to: 'twitter#authorize'
- delete '/twitter/remove', to: 'twitter#remove'
+ match '/auth/twitter/callback', :to => 'twitter#authorize'
+ delete '/twitter/remove', :to => 'twitter#remove'
- match '/auth/:provider/callback', to: 'sessions#create'
- match '/auth/failure', to: 'sessions#failure'
+ match '/auth/:provider/callback', :to => 'sessions#create'
+ match '/auth/failure', :to => 'sessions#failure'
match 'about', :to => 'static#about'
match 'contributing', :to => 'static#contributing'
@@ -1,6 +1,6 @@
class AddPullRequestCounterCacheColumnToUsers < ActiveRecord::Migration
def change
- add_column :users, :pull_requests_count, :integer, default: 0
+ add_column :users, :pull_requests_count, :integer, :default => 0
User.reset_column_information
User.all.each do |p|
View
@@ -31,11 +31,11 @@
puts 'Inserting some test data'
USERS.times do
- user = create :user, gravatar_id: GRAVATARS.sample
+ user = create :user, :gravatar_id => GRAVATARS.sample
user.uid = user.nickname # For developer2 omniauth
user.save!
PULL_REQUESTS.to_a.sample.times do
- create :pull_request, user: user
+ create :pull_request, :user => user
end
end
@@ -44,6 +44,6 @@
end
Rails.configuration.collaborators.each do |collaborator|
- user = create :user, nickname: collaborator.login, gravatar_id: collaborator.gravatar_id
+ user = create :user, :nickname => collaborator.login, :gravatar_id => collaborator.gravatar_id
end
end
@@ -7,7 +7,7 @@
context 'as json' do
before do
create :project
- get :index, format: :json
+ get :index, :format => :json
end
it { should respond_with_content_type(:json) }
@@ -3,7 +3,7 @@
describe PullRequestDownloadsController do
describe "POST 'create'" do
- let(:user) { stub(:user, id: 1, pull_requests: []) }
+ let(:user) { stub(:user, :id => 1, :pull_requests => []) }
before do
session[:user_id] = user.id
@@ -5,7 +5,7 @@
context 'as json' do
before do
create :pull_request
- get :index, format: :json
+ get :index, :format => :json
end
it { should respond_with_content_type(:json) }
@@ -21,7 +21,7 @@
describe 'GET failure' do
before do
- get :failure, message: 'foobar'
+ get :failure, :message => 'foobar'
end
it { should set_the_flash[:notice].to('foobar') }
@@ -18,7 +18,7 @@
context 'as json' do
before do
- get :index, format: :json
+ get :index, :format => :json
end
it { should respond_with_content_type(:json) }
@@ -29,15 +29,15 @@
context 'as html' do
context 'when the case matches' do
before do
- get :show, id: user.nickname
+ get :show, :id => user.nickname
end
it { should respond_with(200) }
end
context 'when the case does not match' do
before do
- get :show, id: user.nickname.upcase
+ get :show, :id => user.nickname.upcase
end
it { should respond_with(200) }
@@ -46,7 +46,7 @@
context 'as json' do
before do
- get :show, id: user.nickname, format: :json
+ get :show, :id => user.nickname, :format => :json
end
it { should respond_with_content_type(:json) }
@@ -26,11 +26,11 @@
its(:repo_name) { should eq json['repo']['name'] }
context 'when the user has authed their twitter account' do
- let(:user) { create :user, twitter_token: 'foo', twitter_secret: 'bar' }
+ let(:user) { create :user, :twitter_token => 'foo', :twitter_secret => 'bar' }
it 'tweets the pull request' do
Twitter::Client.any_instance.should_receive(:update)
- .with(I18n.t 'pull_request.twitter_message', issue_url: json['payload']['pull_request']['issue_url'])
+ .with(I18n.t 'pull_request.twitter_message', :issue_url => json['payload']['pull_request']['issue_url'])
user.pull_requests.create_from_github(json)
end
end
View
@@ -29,11 +29,11 @@
end
describe '#collaborators' do
- let!(:user) { create :user, nickname: 'foobar' }
+ let!(:user) { create :user, :nickname => 'foobar' }
before do
3.times { create :user }
- Rails.configuration.stub(:collaborators).and_return([ Hashie::Mash.new(login: 'foobar') ])
+ Rails.configuration.stub(:collaborators).and_return([ Hashie::Mash.new(:login => 'foobar') ])
end
subject { described_class.collaborators }
@@ -42,7 +42,7 @@
describe '.estimate_skills' do
let(:github_client) { double('github client') }
- let(:repos) { Project::LANGUAGES.sample(3).map { |l| Hashie::Mash.new(language: l) } }
+ let(:repos) { Project::LANGUAGES.sample(3).map { |l| Hashie::Mash.new(:language => l) } }
before do
user.stub(:github_client).and_return(github_client)
@@ -63,7 +63,7 @@
context 'when the user has skillz' do
before do
- create :skill, language: 'JavaScript', user: user
+ create :skill, :language => 'JavaScript', :user => user
end
it { should eq ['JavaScript'] }
@@ -104,7 +104,7 @@
context 'when a pull request is added' do
before do
- create :pull_request, user: user
+ create :pull_request, :user => user
user.reload
end
@@ -1,7 +1,7 @@
require 'spec_helper'
describe 'Projects' do
- let(:user) { create :user, email_frequency: 'daily' }
+ let(:user) { create :user, :email_frequency => 'daily' }
subject { page }
describe 'project index' do
@@ -21,10 +21,10 @@
it 'allows the user to suggest a project to contribute to' do
click_link 'Suggest a project'
- fill_in 'Name', with: Faker::Lorem.words.first
- fill_in 'Github url', with: 'http://github.com/andrew/24pullrequests'
- fill_in 'Summary', with: Faker::Lorem.paragraphs.first
- fill_in 'Main language', with: 'Ruby'
+ fill_in 'Name', :with => Faker::Lorem.words.first
+ fill_in 'Github url', :with => 'http://github.com/andrew/24pullrequests'
+ fill_in 'Summary', :with => Faker::Lorem.paragraphs.first
+ fill_in 'Main language', :with => 'Ruby'
click_on 'Submit Project'
end
end
@@ -43,9 +43,9 @@
context 'as logged-in user' do
before do
- create :project, name: 'Ruby project', main_language: 'Ruby'
- create :project, name: 'Java project', main_language: 'Java'
- user.skills.create! language: 'Ruby'
+ create :project, :name => 'Ruby project', :main_language => 'Ruby'
+ create :project, :name => 'Java project', :main_language => 'Java'
+ user.skills.create! :language => 'Ruby'
login user
visit projects_path
end
@@ -10,12 +10,12 @@
visit root_path
end
- it { should have_link('Log in with GitHub', href: login_path) }
+ it { should have_link('Log in with GitHub', :href => login_path) }
it { should have_content('5 Developers already involved') }
it { should have_content('2 Suggested Projects') }
- it { should have_link('View All', href: users_path) }
- it { should have_link('View All', href: projects_path) }
- it { should have_link('View All', href: pull_requests_path) }
- it { should have_link('Suggest a project', href: new_project_path) }
+ it { should have_link('View All', :href => users_path) }
+ it { should have_link('View All', :href => projects_path) }
+ it { should have_link('View All', :href => pull_requests_path) }
+ it { should have_link('Suggest a project', :href => new_project_path) }
end
end
@@ -1,7 +1,7 @@
require 'spec_helper'
describe 'Twitter' do
- let(:user) { create :user, email_frequency: 'never' }
+ let(:user) { create :user, :email_frequency => 'never' }
subject { page }
before do
@@ -11,7 +11,7 @@
describe 'Linking twitter account' do
context 'when the user has not linked their twitter account' do
- it { should have_link('Link Your Twitter Account', href: '/auth/twitter') }
+ it { should have_link('Link Your Twitter Account', :href => '/auth/twitter') }
it 'allows the user to link their twitter account' do
mock_twitter_auth
@@ -23,23 +23,23 @@
end
context 'when the user has already linked their twitter account' do
- let(:user) { create :user, email_frequency: 'never', twitter_token: 'foo', twitter_secret: 'bar' }
+ let(:user) { create :user, :email_frequency => 'never', :twitter_token => 'foo', :twitter_secret => 'bar' }
it { should_not have_link('Link Your Twitter Account') }
end
end
describe 'removing twitter account' do
context 'when the user has linked their twitter account' do
- let(:user) { create :user, email_frequency: 'never',
- twitter_nickname: Faker::Lorem.word,
- twitter_token: SecureRandom.hex,
- twitter_secret: SecureRandom.hex }
+ let(:user) { create :user, :email_frequency => 'never',
+ :twitter_nickname => Faker::Lorem.word,
+ :twitter_token => SecureRandom.hex,
+ :twitter_secret => SecureRandom.hex }
before do
visit preferences_path
end
- it { should have_link("@#{user.twitter_nickname}", href: "https://twitter.com/#{user.twitter_nickname}")}
- it { should have_link('Remove Account', href: twitter_remove_path) }
+ it { should have_link("@#{user.twitter_nickname}", :href => "https://twitter.com/#{user.twitter_nickname}")}
+ it { should have_link('Remove Account', :href => twitter_remove_path) }
describe 'clicking remove account' do
before do
View
@@ -11,7 +11,7 @@
OmniAuth.config.test_mode = true
-WebMock.disable_net_connect! allow_localhost: true
+WebMock.disable_net_connect! :allow_localhost => true
if ENV['CI']
require 'capybara/poltergeist'
@@ -50,7 +50,7 @@
DatabaseCleaner.strategy = :transaction
end
- config.before(:each, js: true) do
+ config.before(:each, :js => true) do
DatabaseCleaner.strategy = :truncation
end
Oops, something went wrong.

0 comments on commit 170ca52

Please sign in to comment.