Skip to content

Instantly share code, notes, and snippets.

@mfifth
Created May 17, 2016 00:26
Show Gist options
  • Save mfifth/a224d2434b3de584424940663b1e0b83 to your computer and use it in GitHub Desktop.
Save mfifth/a224d2434b3de584424940663b1e0b83 to your computer and use it in GitHub Desktop.
require 'rails_helper'
RSpec.describe "Administrators can create posts and enable user privileges" do
let(:admin) { FactoryGirl.create(:user, :admin) }
before do
login_as(admin)
visit '/'
end
scenario 'successfully inside the index page from admin lounge' do
click_link 'Admin'
click_link "New User"
fill_in "Email", with: "[email protected]"
fill_in "Password", with: "password"
click_button "Create User"
expect(page).to have_content 'New user has been created.'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment