Skip to content

Instantly share code, notes, and snippets.

@osiro
Created June 12, 2014 08:24
Show Gist options
  • Save osiro/602e3f3233a8887298b6 to your computer and use it in GitHub Desktop.
Save osiro/602e3f3233a8887298b6 to your computer and use it in GitHub Desktop.
require 'feature_helper'
feature "project coordinators can view a project" do
background do
sign_in_as :user
end
scenario "successfully viewing a project", js: true do
create_project_for_user
visit projects_path
page.execute_script("$(\"article[data-project-id=#{@project.id}] img\").click()")
current_path.should eq project_path(@project)
page.should have_content @project
end
private
def create_project_for_user
@project = FactoryGirl.create :project
ProjectCoordinator.create user: current_user, project: @project
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment