diff --git a/README.md b/README.md index e1460c8..d035b79 100644 --- a/README.md +++ b/README.md @@ -7,33 +7,41 @@ Tagged Gist [![Dependency Status](https://gemnasium.com/i2bskn/tagged-gist.png)](https://gemnasium.com/i2bskn/tagged-gist) -Creating... +Web application to tag the Gists. -== README +#### Application on Heroku -This README would normally document whatever steps are necessary to get the -application up and running. +[https://tagged-gist.herokuapp.com](https://tagged-gist.herokuapp.com) -Things you may want to cover: +## Requirements -* Ruby version +* Ruby 2.0.0 +* PostgreSQL -* System dependencies +## Configuration -* Configuration +#### Sessions secret key -* Database creation +``` +export RAILS_SECRET_KEY=rails_secret_key_base +``` -* Database initialization +#### GitHub Application config -* How to run the test suite +``` +export GITHUB_KEY=your_app_client_id +export GITHUB_SECRET=your_app_client_secret +``` -* Services (job queues, cache servers, search engines, etc.) +## Deproyment instructions -* Deployment instructions +#### for Heroku -* ... - - -Please feel free to use a different markup language if you do not plan to run -rake doc:app. +``` +heroku create +heroku config:set RAILS_SECRET_KEY=rails_secret_key_base +heroku config:set GITHUB_KEY=your_app_client_id +heroku config:set GITHUB_SECRET=your_app_client_secret +git push heroku master +heroku open +``` diff --git a/spec/controllers/sessions_controller_spec.rb b/spec/controllers/sessions_controller_spec.rb index 702c559..6ef7e4b 100644 --- a/spec/controllers/sessions_controller_spec.rb +++ b/spec/controllers/sessions_controller_spec.rb @@ -1,5 +1,27 @@ require 'spec_helper' describe SessionsController do + let(:user) {FactoryGirl.create(:user)} + def valid_session + {user: user.id} + end + + describe "GET destroy" do + it "returns http redirect" do + get :destroy, {}, valid_session + expect(response).to be_redirect + end + + it "should redirect to root_path" do + get :destroy, {}, valid_session + expect(response).to redirect_to(root_path) + end + + it "should clear session" do + session[:user] = user.id + get :destroy, {}, valid_session + expect(session[:user]).to be_nil + end + end end