Sha256: ea5e401d2f1bc6ec9868e0e1f87db360514f546dc48533212f79277efba8d869

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

require 'spec_helper'

feature "managing snippets", type: :feature do
  background do
    mock_sign_in(:admin)
  end

  scenario "Adding a new snippet" do
    visit OpenConferenceWare.mounted_path("/manage/snippets")
    click_link "New snippet"
    fill_in "Slug", with: "testing_snippet"
    fill_in "Description", with: "This is a snippet to test snippet editing"
    fill_in "Content", with: "lorem ipsum"
    click_button "Create"

    page.should have_content "Snippet was successfully created."
  end

  scenario "Editing a snippet" do
    snippet = create(:snippet)
    new_content = "!!snippet content!!"
    visit OpenConferenceWare.mounted_path("/manage/snippets")
    click_link snippet.slug
    click_link "Edit"
    fill_in "Content", with: new_content
    click_button "Update"

    page.should have_content "Snippet was successfully updated."
    page.should have_content new_content
  end

  scenario "Deleting a snippet" do
    snippet = create(:snippet)
    visit manage_snippet_path(snippet)
    click_link "Destroy"
    page.should have_content "Snippet was deleted."
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
open_conference_ware-1.0.0.pre4 spec/features/snippets_spec.rb
open_conference_ware-1.0.0.pre3 spec/features/snippets_spec.rb
open_conference_ware-1.0.0.pre2 spec/features/snippets_spec.rb
open_conference_ware-1.0.0.pre1 spec/features/snippets_spec.rb