Sha256: 34ea26718d1edd9835c45ad22cc9436713482569b9163a029076c1ba00a01c5a
Contents?: true
Size: 1011 Bytes
Versions: 1
Compression:
Stored size: 1011 Bytes
Contents
require 'spec_helper' describe "topics" do context "authenticated users" do before do sign_in! end it "creating a new one" do visit topics_path click_link "New Topic" fill_in "Subject", :with => "First topic!" fill_in "Text", :with => "First post!" click_button "Create Topic" within "#flash_notice" do page.should have_content("Topic has been created!") end within ".forem_topic #posts .forem_post" do page.should have_content("First post!") end within ".forem_topic #posts .forem_post .user" do page.should have_content("forem_user") end end end context "unauthenticated users" do before do sign_out! end it "cannot see the 'New Topic' link" do visit topics_path page.should_not have_content("New Topic") end it "cannot begin to create a new topic" do visit new_topic_path page.current_url.should eql(sign_in_url) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
prusswan-forem-0.0.2 | spec/requests/topics_spec.rb |