Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dependency on user_type of create :user. #14752

Merged
merged 2 commits into from May 2, 2017
Merged

Conversation

ashercodeorg
Copy link
Contributor

@ashercodeorg ashercodeorg commented May 1, 2017

No description provided.

@ashercodeorg ashercodeorg changed the title Test dependency on user_type of create :user. Remove dependency on user_type of create :user. May 1, 2017
@ashercodeorg ashercodeorg requested a review from aoby May 1, 2017 17:18
refute ability.can?(:destroy, Level)
refute ability.can?(:destroy, Activity)

assert ability.can?(:read, Section)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied from "as student", with the can?(:read, Section) changed from refute to assert.

@@ -35,8 +35,8 @@ class AbilityTest < ActiveSupport::TestCase
refute ability.can?(:read, @login_required_script_level)
end

test "as member" do
ability = Ability.new(create(:user))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test fails with create(:teacher).

@@ -25,7 +25,7 @@ class ApiControllerTest < ActionController::TestCase
# some of our tests depend on sorting of students by name, thus we name them ourselves
@students = []
5.times do |i|
student = create(:user, name: "student_#{i}")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test fails with create(:teacher, name: "student_#{i}").

@ashercodeorg
Copy link
Contributor Author

The eyes failures should be unrelated.

@ashercodeorg ashercodeorg merged commit a1bc5db into staging May 2, 2017
@ashercodeorg ashercodeorg deleted the userMeansUser branch May 2, 2017 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants