mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-01-24 17:27:50 -05:00
19 lines
433 B
Ruby
19 lines
433 B
Ruby
require 'rails_helper'
|
|
|
|
describe RolesController do
|
|
def valid_attributes
|
|
{ "name" => "MyString" }
|
|
end
|
|
|
|
login_member(:admin_member)
|
|
|
|
describe "GET index" do
|
|
it "assigns all roles as @roles" do
|
|
role = Role.create! valid_attributes
|
|
get :index, params: {}
|
|
# note that admin role exists because of login_admin_member
|
|
assigns(:roles).should eq([Role.find_by(name: 'admin'), role])
|
|
end
|
|
end
|
|
end
|