Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting in Gemfile #216

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 25 additions & 21 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
source 'https://rubygems.org'

ruby "2.2.0"
ruby '2.2.4'

gem 'rails', '~> 4.2.4'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem "devise"
gem "cancancan"
gem "haml-rails"
gem 'devise'
gem 'cancancan'
gem 'haml-rails'
gem 'coffee-rails'
gem 'gmaps4rails', '~> 1.5.6'
gem 'geocoder'
gem "unicorn"
gem "rack-timeout", '0.0.4' # https://github.com/heroku/rack-timeout/issues/55
gem "sidekiq"
gem "sinatra", require: false # Required for Sidekiq web interface
# gem 'unicorn'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we use unicorn still?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably right. Adding back gem.

gem 'rack-timeout', '0.0.4' # https://github.com/heroku/rack-timeout/issues/55
gem 'sidekiq'
gem 'sinatra', require: false # Required for Sidekiq web interface

gem "devise-async"
gem "gravatar-ultimate"
gem 'devise-async'
gem 'gravatar-ultimate'
# render markdown
gem "redcarpet", "~> 1.17.2"
gem "icalendar"
gem 'redcarpet', '~> 1.17.2'
gem 'icalendar'

# parse urls
gem "addressable"
gem 'addressable'

gem "twitter"
gem 'twitter'

group :development do
gem 'letter_opener'
Expand All @@ -44,7 +44,7 @@ end
gem 'sass-rails', '~> 4.0.0' # v5 breaks CI
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem "uglifier", '~> 2.1.1'
gem 'uglifier', '~> 2.1.1'

gem 'httparty'

Expand All @@ -64,25 +64,29 @@ gem 'socket.io-client-simple'
gem 'houston'

group :test do
gem "factory_girl_rails"
gem "timecop"
gem 'factory_girl_rails'
gem 'timecop'
gem 'shoulda-matchers'
gem 'simplecov', :require => false # code coverage tool
gem "database_cleaner"
gem 'database_cleaner'
gem 'email_spec'
gem "webmock"
gem 'webmock'
end

group :test, :development do
gem "rspec-rails"
gem 'rspec-rails'
gem 'capybara'
gem 'poltergeist'
gem 'pry-rails'
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
gem 'sqlite3'


end


# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
gem 'bcrypt-ruby', '~> 3.0.0', :require => 'bcrypt'

# To use Jbuilder templates for JSON
# gem 'jbuilder'
Expand Down
13 changes: 8 additions & 5 deletions app/controllers/polls_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class PollsController < ApplicationController


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace detected.

load_and_authorize_resource only: [:new, :create, :edit, :update]
before_action :authenticate_user!

# GET /polls
Expand Down Expand Up @@ -27,12 +28,13 @@ def show
# GET /polls/new
# GET /polls/new.json
def new
@poll = Poll.new
@poll = Poll.new

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use 2 (not 4) spaces for indentation.

respond_to do |format|
format.html # new.html.erb

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use 2 (not 4) spaces for indentation.

format.json { render json: @poll }

respond_to do |format|
format.html # new.html.erb
format.json { render json: @poll }
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra empty line detected at method body end.

end

# GET /polls/1/edit
Expand All @@ -43,6 +45,7 @@ def edit
# POST /polls
# POST /polls.json
def create

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra empty line detected at method body beginning.

@poll = Poll.new(poll_params)

respond_to do |format|
Expand Down
9 changes: 4 additions & 5 deletions app/views/polls/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@

[email protected] do |poll|
.poll{'data-id' => poll.id}
%h2=poll.question
%h2= poll.question
.publish
=render :partial => "polls/publish_link", :locals => {:poll => poll}
.actions
= link_to 'Show', poll
= link_to 'Edit', edit_poll_path(poll)
= link_to 'Destroy', poll, method: :delete, data: { confirm: 'Are you sure?' }
= link_to 'Edit', edit_poll_path(poll)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line contains trailing whitespace

= link_to 'Destroy', poll, method: :delete, data: { confirm: 'Are you sure?' }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [85/80]
Line contains trailing whitespace



= link_to 'New Poll', new_poll_path
= link_to 'New Poll', new_poll_path if can? :manage, :polls
4 changes: 2 additions & 2 deletions app/views/polls/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
%b Question:
= @poll.question

= link_to 'Edit', edit_poll_path(@poll)
= link_to 'Edit', edit_poll_path(@poll) if can? :manage, :polls
\|
= link_to 'Back', polls_path
= link_to 'Back', polls_path if can? :manage, :polls
1 change: 0 additions & 1 deletion spec/acceptance/lessons_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@
uri = URI.parse(current_url)
uri.path.should == root_path
end

end

feature %q{
Expand Down
24 changes: 23 additions & 1 deletion spec/acceptance/polls_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
page.should have_css("p", :text => "Poll was successfully updated.", :visible => true)
end


end

feature %q{
Expand All @@ -55,4 +54,27 @@
save_and_open_page
page.should have_css(".polls", :visible => true)
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra empty line detected at block body end.

end

feature %q{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use %q only for strings that contain both single quotes and double quotes.

As a website
I want to make sure,
That non-admin user
Can't create polls
} do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra empty line detected at block body beginning.

background do
@user = FactoryGirl.create(:user)
venue = FactoryGirl.create(:venue)
@user.school = venue.school
sign_in_manually @user
end

scenario "Non-admin user is trying to access polls", :js => true do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the new Ruby 1.9 hash syntax.

visit new_poll_path
uri = URI.parse(current_url)
uri.path.should == root_path
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra empty line detected at block body end.

end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final newline missing.