forked from wahl77/Nearbuy
-
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.
Now made quick-post look a bit better
- Loading branch information
Showing
10 changed files
with
79 additions
and
13 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 |
---|---|---|
|
@@ -36,3 +36,4 @@ guard 'bundler' do | |
# Uncomment next line if Gemfile contain `gemspec' command | ||
# watch(/^.+\.gemspec/) | ||
end | ||
|
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
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 |
---|---|---|
|
@@ -8,13 +8,27 @@ | |
login(@user) | ||
end | ||
|
||
it "loads a blank page" do | ||
it "loads a blank page" do | ||
visit logout_path | ||
visit root_path | ||
expect(page).to have_content "A great place" | ||
end | ||
|
||
it "can log in/out" do | ||
it "can sign up" do | ||
visit logout_path | ||
visit root_path | ||
click_link "Login" | ||
click_link "Signup" | ||
within("form#new_user") do | ||
fill_in "Email", with: "[email protected]" | ||
fill_in "Password", with: "ba$8903<#" | ||
fill_in "Password Confirmation", with: "ba$8903<#" | ||
end | ||
click_button "Signup" | ||
expect(page).to have_content "User was successfully created." | ||
end | ||
|
||
it "can log in/out" do | ||
visit logout_path | ||
expect(page).to have_content "Logged Out" | ||
visit root_path | ||
|
@@ -23,10 +37,29 @@ | |
@user.password = "a" | ||
@user.save | ||
fill_in "password", with: "a" | ||
within("#login_modal") do | ||
within("#login_modal") do | ||
click_button "Login" | ||
end | ||
expect(page).to have_content "Logged in successfully!" | ||
end | ||
|
||
describe "Check only authorized pages if not logged in" do | ||
before do | ||
visit logout_path | ||
@login_first = "Please login first" | ||
end | ||
it "cannot create new item" do | ||
visit new_item_path | ||
expect(page).to have_content @login_first | ||
end | ||
|
||
it "can view an item but not post a comment" do | ||
item = FactoryGirl.create(:item) | ||
visit item_path(item) | ||
expect(page).to have_content item.name | ||
visit edit_item_path(item) | ||
expect(page).to have_content @login_first | ||
end | ||
end | ||
|
||
end |
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,4 @@ | ||
Capybara.register_driver :selenium do |app| | ||
Capybara::Selenium::Driver.new(app, :browser => :chrome) | ||
end | ||
#Capybara.javascript_driver = :chrome |