Skip to content

Commit

Permalink
add specs
Browse files Browse the repository at this point in the history
  • Loading branch information
i2bskn committed Jul 13, 2013
1 parent 8844799 commit 874ef64
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 18 deletions.
44 changes: 26 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<tt>rake doc:app</tt>.
```
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
```
22 changes: 22 additions & 0 deletions spec/controllers/sessions_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 874ef64

Please sign in to comment.