Skip to content

Commit

Permalink
Added logos and simplecov to test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
cajun-code committed Feb 3, 2012
1 parent 675d41a commit ae59817
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -8,3 +8,4 @@ tmp/
.DS_Store
*~
doc/app
coverage
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -25,6 +25,7 @@ group :development, :test do
gem 'mailcatcher'
gem 'rspec-rails'
gem 'factory_girl_rails'
gem 'simplecov', :require => false
gem 'sqlite3'
end

Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Expand Up @@ -146,6 +146,10 @@ GEM
railties (~> 3.1.0)
sass (~> 3.1.10)
tilt (~> 1.3.2)
simplecov (0.5.4)
multi_json (~> 1.0.3)
simplecov-html (~> 0.5.3)
simplecov-html (0.5.3)
sinatra (1.3.1)
rack (~> 1.3, >= 1.3.4)
rack-protection (~> 1.1, >= 1.1.2)
Expand Down Expand Up @@ -188,5 +192,6 @@ DEPENDENCIES
rails (= 3.1.1)
rspec-rails
sass-rails (~> 3.1.4)
simplecov
sqlite3
uglifier (>= 1.0.3)
Binary file added app/assets/images/ic_launcher-web.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions app/controllers/story_controller.rb
Expand Up @@ -73,12 +73,12 @@ def close_voting
def status_voting
@room = Room.find(params[:room_id])
@votes = @room.story_votes.where(:story_id => params[:id])
counts = @votes.count
users = @room.users.count
precentage = counts.to_f / users.to_f * 100.0
puts "Votes: #{counts} Users: #{users} Precentage: #{precentage}"
@counts = @votes.count
@users = @room.users.count
@precentage = @counts.to_f / @users.to_f * 100.0
puts "Votes: #{@counts} Users: #{@users} Precentage: #{@precentage}"
data = {}
data[:value] = precentage
data[:value] = @precentage
# data[:total_vote_count] = @room.users.count
render :json => data.as_json
end
Expand Down
15 changes: 11 additions & 4 deletions spec/controllers/token_controller_spec.rb
@@ -1,11 +1,18 @@
require 'spec_helper'

describe TokenController do

describe "GET 'index'" do
it "returns http success" do
get 'index'
before(:each) do
@user = Factory(:user)
end
describe "POST 'fetch'" do
it "should return token of user loging in" do
post 'fetch', :user_name => @user.email, :password => @user.password
response.should be_success
response.body.should == @user.authentication_token
end
it "should return a 403 if not a valid user" do
post 'fetch', :user_name => @user.email, :password => "pain"
response.response_code.should == 403
end
end

Expand Down
3 changes: 2 additions & 1 deletion spec/spec_helper.rb
Expand Up @@ -3,7 +3,8 @@
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'

require 'simplecov'
SimpleCov.start
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
Expand Down

0 comments on commit ae59817

Please sign in to comment.