Permalink
Browse files

fixed scenarios to include login first

  • Loading branch information...
1 parent c8099ac commit bc1ed032af8dbcc046dacc311023197238cee58a @drnic committed Oct 10, 2009
View
4 features/compose_new_message.feature
@@ -4,8 +4,8 @@ Feature: Compose new message
I want to be send a message to another user
Scenario: Compose new message
- When I am on the inbox page
- And I follow "Compose "
+ Given I am logged in as "drnic"
+ When I follow "Compose "
And I fill in "To:" with "defunkt"
And I fill in "Subject:" with "Sending a message"
And I fill in "message_body" with "This is the body of the message"
View
6 features/mailboxes_are_paginated.feature
@@ -4,7 +4,8 @@ Feature: Mailboxes are paginated
I want to navigate to additional pages
Scenario: Navigate across several pages in the inbox
- Given I have 35 messages in my "inbox" mailbox
+ Given I am logged in as "drnic"
+ And I have 35 messages in my "inbox" mailbox
When I am on the inbox page
Then I see 10 messages in the mailbox
When I follow "Next"
@@ -15,7 +16,8 @@ Feature: Mailboxes are paginated
Then I see 5 messages in the mailbox
Scenario: Navigate across several pages in the sent mailbox
- Given I have 35 messages in my "sent" mailbox
+ Given I am logged in as "drnic"
+ And I have 35 messages in my "sent" mailbox
When I am on the inbox page
Then I see 0 messages in the mailbox
And I follow "Sent Messages"
View
3 features/setup_inbox_messages.feature
@@ -4,7 +4,8 @@ Feature: Setup inbox
I want to be able to explicitly determine what messages are in the inbox
Scenario: Setup messages
- Given I add the following messages to "inbox" mailbox:
+ Given I am logged in as "drnic"
+ And I add the following messages to "inbox" mailbox:
| Github message number | From github login | Sent time ago | Subject | Body | Unread |
| 269383 | dhh | 12 hours ago | Rails 3.0 released! | Go get it | true |
| 269380 | defunkt | 25 hours ago | No more rubygems | Long live Rubyforge. | false |
View
2 features/setup_sent_messages.feature
@@ -4,7 +4,7 @@ Feature: Setup sent mailbox messages
I want to be able to explicitly determine what messages are in the mailbox
Scenario: Setup messages
- Given I have no messages
+ Given I am logged in as "drnic"
When I add the following messages to "sent" mailbox:
| Github message number | From github login | Sent time ago | Subject | Body | Unread |
| 269383 | dhh | 12 hours ago | Rails 3.0 released! | Go get it | true |
View
7 features/step_definitions/github_steps.rb
@@ -1,4 +1,9 @@
Given /^I am logged in as "([^\"]*)"$/ do |login|
-
+ User.make(:login => login, :password => 'secret', :password_confirmation => 'secret')
+ visit path_to("the home page")
+ click_link "Login"
+ fill_in("login", :with => login)
+ fill_in("password", :with => "secret")
+ click_button "Log in"
end

0 comments on commit bc1ed03

Please sign in to comment.