Created
March 3, 2012 18:13
-
-
Save choxi/1967200 to your computer and use it in GitHub Desktop.
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
require 'spec_helper' | |
describe "Bookmarks" do | |
describe "GET /bookmarks" do | |
context "when user is not logged in" do | |
it "should redirect a to home" do | |
get bookmarks_path | |
response.should redirect_to(root_url) | |
end | |
end | |
context "when user is logged in" do | |
let(:user) { | |
user = create(:user).confirm! | |
login_as(user, :scope => :user) | |
user | |
} | |
context "and has no bookmarks," do | |
it "should display a getting started help if the user has no bookmarks" do | |
get bookmarks_path | |
page.should have_content("Get started:") | |
page.should have_content("Import bookmarks:") | |
page.should have_content("Drag the bookmarklet:") | |
end | |
end | |
context "and has bookmarks," do | |
before(:all) do | |
bookmark_file = File.open( Rails.root.join("spec", "support", "bookmarks.html") ) | |
# the let you defined above for "user" is available here, but it needs to be in an RSpec block | |
BookmarkImporter.new(bookmark_file, user) | |
end | |
describe "main page" do | |
it "should display the unsorted bookmarks board" do | |
visit bookmarks_path | |
page.should have_content("Unsorted") | |
end | |
it "should display all boards" do | |
pending | |
end | |
it "should have a way to access account settings" do | |
pending | |
end | |
end | |
describe "board" do | |
it "should display bookmarks inside" do | |
pending | |
end | |
it "should allow deletion" do | |
pending | |
end | |
end | |
describe "bookmarks" do | |
it "should allow deletion" do | |
pending | |
end | |
it "should allow dragging and dropping between boards" do | |
pending | |
end | |
end | |
describe "archiving" do | |
it "should be able to show archive buttons" do | |
pending | |
end | |
it "should be able to show archived bookmarks" do | |
pending | |
# archived bookmarks should be hidden | |
# archived bookmarks should be hidden and shown after clicking the link | |
end | |
it "should hide the bookmark when archived" do | |
pending | |
end | |
it "should display the bookmark when unarchived" do | |
pending | |
end | |
end | |
end # end user has bookmarks context | |
end #end user logged in context | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment