-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7301b27
commit f526ce9
Showing
4 changed files
with
58 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
require 'spec_helper' | ||
|
||
describe "test service requests" do | ||
|
||
before(:each) do | ||
@user = Factory(:user) | ||
#@user = Factory(:user, :password => "password") | ||
@user = User.create!(:email => "[email protected]", :password => "password") | ||
@service = Factory(:service, :user => @user) | ||
end | ||
|
||
|
@@ -11,12 +13,31 @@ | |
visit edit_service_path(@service.id) | ||
current_path.should == sign_in_path | ||
end | ||
|
||
it "should be able to log in" do | ||
visit services_path | ||
click_link "[Sign in]" | ||
fill_in "Email", with: "[email protected]" | ||
fill_in "Password", with: "password" | ||
click_button "Sign in" | ||
sleep 3 | ||
current_path.should | ||
page.should have_content "[email protected]" | ||
end | ||
end | ||
|
||
context "when logged in" do | ||
context "when logged in", :js => true do | ||
before do | ||
sign_in_as @user | ||
#sign_in_as @user | ||
#post_via_redirect session_path, 'session[email]' => @user.email, 'session[password]' => @user.password | ||
visit services_path | ||
click_link "[Sign in]" | ||
fill_in "Email", with: "[email protected]" | ||
fill_in "Password", with: "password" | ||
click_button "Sign in" | ||
sleep 3 | ||
end | ||
|
||
it "should be able to create a service" do | ||
# From homepage, see post listing | ||
visit services_path | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require 'spec_helper' | ||
|
||
describe "test logging in" do | ||
|
||
before(:each) do | ||
@user = User.create!(:email => "[email protected]", :password => "password") | ||
end | ||
|
||
context "when logged out" do | ||
|
||
it "should be able to log in", :js=>true do | ||
ap @user | ||
visit sign_in_path | ||
fill_in "Email", with: "[email protected]" | ||
fill_in "Password", with: "password" | ||
click_button "Sign in" | ||
page.find(".user").should have_content "[email protected]" | ||
end | ||
end | ||
end |