Skip to content

Instantly share code, notes, and snippets.

@osiro
Created July 6, 2015 03:32

Revisions

  1. osiro created this gist Jul 6, 2015.
    26 changes: 26 additions & 0 deletions volunteer_create_shift_user_spec.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    require 'rails_helper'

    feature 'Volunteer can view profile of event', js: true do

    sign_in_as(:volunteer)

    scenario 'Volunteer participate to events' do
    event = FactoryGirl.create(:event).decorate
    visit(volunteer_event_path(event))

    within("table.shifts") do
    click_on "Volunteer"
    end

    within(".shift-user.popup-content") do
    expect(page).to have_content event.name
    click_on "I want to volunteer"
    end

    within("table.shifts") do
    expect(page).to have_content("Withdrawn")
    end

    expect(event.shifts.first.users).to include(current_user)
    end
    end