Created
July 26, 2012 13:02
-
-
Save dsci/3181918 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Adding a post to my timeline | |
In order to tell my friends what I currently do | |
As registered user | |
I want to add a post | |
Background: Existing user is logged in | |
Given my username is "dsci",my password is "123456" and my email is "[email protected]" | |
When I visit the ritter start page | |
Then I should see the login form | |
When I fill in "email" with "dsci" | |
And I fill in "Your Password" with "123456" | |
And I press "Sign in" | |
Then I should see that I'm logged in | |
Scenario: Successfull composing a post | |
When I see the post form | |
And I fill in "Write a post" with "*Currently* it rains like cats and dogs" | |
And I press "Ritterize that" | |
Then I should see "You composed your post successfully." | |
And I should see "<p><strong>Currently</strong> it rains like cats and dogs</p>" on my timeline | |
And I should see "You have 1 post(s) at all." | |
When I add another post "The second I want to write", I should see "You have 2 post(s) at all." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomFailure < Devise::FailureApp | |
def redirect_url | |
root_url | |
end | |
# You need to override respond to eliminate recall | |
def respond | |
if http_auth? | |
http_auth | |
else | |
redirect | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.warden do |manager| | |
manager.failure_app = CustomFailure | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="login"> | |
<h2>Login to ritter</h2> | |
<%= form_tag user_session_path, :class=>"form-horizontal well" do %> | |
<fieldset> | |
<div class="control-group"> | |
<%= label_tag 'user_login','email'%> | |
<%= text_field_tag 'user[login]'%> | |
</div> | |
<div class="control-group"> | |
<%= label_tag 'user_password','Your Password' %> | |
<%= password_field_tag 'user[password]' %> | |
</div> | |
<%= submit_tag "Sign in", :class => "btn btn-success" %> | |
</fieldset> | |
<%end%> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Logging into ritter app | |
In order to use the ritter app features | |
As registered user | |
I want to login | |
Background: Existing User wants to login | |
Given my username is "dsci",my password is "123456" and my email is "[email protected]" | |
When I visit the ritter start page | |
Then I should see the login form | |
Scenario: Successfull login with email address | |
When I fill in "Username or email" with "[email protected]" | |
And I fill in "Your Password" with "123456" | |
And I press "Sign in" | |
Then I should see my username "dsci" and that I'm logged in | |
Scenario: Unsuccessfull login with wrong password | |
When I fill in "Username or email" with "[email protected]" | |
And I fill in "Your Password" with "qwrwzweu" | |
And I press "Sign in" | |
Then I should see that I entered something wrong | |
And I am back at the login page |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Logout from ritter app | |
In order to went away from my computer | |
As a logged in user | |
I want to log me out | |
Background: Existing user is logged in | |
Given my username is "dsci",my password is "123456" and my email is "[email protected]" | |
When I visit the ritter start page | |
Then I should see the login form | |
When I fill in "Username or email" with "dsci" | |
And I fill in "Your Password" with "123456" | |
And I press "Sign in" | |
Then I should see that I'm logged in | |
Scenario: Logout Successfull | |
When I click "Sign out" | |
Then I should see "Signed out successfully." | |
And I should see the login form |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment