NYULibraries/ichabod — pull request #31 by eshadatta (2014-06-13 14:05:47+00:00)
Title: Feature/create gis cataloger role

@barnabyalter and @NYULibraries/hydra , I have created a branch for my user story: https://www.pivotaltracker.com/s/projects/1025368/stories/70442354. There are many problems with this branch and I created a PR to get feedback.

Issues/Notes:
1. I created the roles in config/role_map* and added permissions in app/models/ability.rb
2. In my rspec test which is in spec/models/ability_spec, I use a vcr to create a nyucore record. I then try to create a gis user by overriding the factory girl username setting and doing one test. It failed. So, I did a test just using the create user function and that will, of course, fail. So, I tried to output the user1 variable to see what I get, but it outputs nothing.

Basically, I've been trying to get a user of type gis that will have permissions to manage this record. I'm probably missing something completely obvious, so I would really appreciate feedback. Also, my code in ability.rb might be wrong.

Also, since my tests are for command line only, I did not use a vcr cassette for a user since I am not replicated the test to see if a user is logged in but merely testing to see if a user of a username specified in role_map* has CRUD permissions for GIS record.

My other question was about the Nyucore factory girl record creation. Is the assumption that all Nyucore records will be of type Geospatial Data? Because I see that in the factory girl setting. My assumption from my user story is that all GIS datasets will have type Geospatial Data. So, should we have factory girl settings that explicitly create different types of datasets for testing? Just a thought.

Thanks in advance for your feedback.