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

345/bruteforce/event not deleteable after start #418

Closed

Conversation

usame-algan
Copy link
Contributor

@usame-algan usame-algan commented Jan 22, 2018

closes #345

@ghost ghost assigned usame-algan Jan 22, 2018
@ghost ghost added the review label Jan 22, 2018
expect(page).not_to have_css('a', :text => I18n.t('helpers.links.destroy'))
end
end

Copy link
Contributor

Choose a reason for hiding this comment

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

If we're working with cucumber now this test isn't needed anymore. Cucumber replaces all our feature tests.

@@ -145,7 +145,7 @@
end

it 'should allow users to crud events they created' do
event = Event.new(owner: @user)
event = FactoryBot.create(:event, :has_dates, owner_id: @user.id)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is awkward because it's not really obvious why the even needs to have dates, I'd rather see this in a sperate ability test only for Tournaments and leagues, because rankinglists don't have any dates. Also adding another test with the other case (when you cannot delete the event) would be a good idea imo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Users can only delete events now under certain conditions so this test has to be changed. But I agree that the event object having a date here is weird. I will change this test and create a separate one for the changed delete ability.

Scenario: Admin can delete event any time, organizer does not
Given an event that has started
Then the admin should be able to delete it
And the organizer should not be able to delete it
Copy link
Contributor

Choose a reason for hiding this comment

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

Implement the steps for this please :) If you need help don't be afraid to ask, although my knowledge about cucumber is also still quite limited.

@@ -55,6 +56,10 @@ def deadline_has_passed?
deadline < Date.current
end

def startdate_has_passed?
startdate < Date.current
end
Copy link
Contributor

Choose a reason for hiding this comment

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

This method is only used in your tests, nowhere else. Is that intentional? I don't really see how this adds the expected behaviour yet.

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 is from an earlier implementation that is actually not needed anymore.

@Askir
Copy link
Contributor

Askir commented Feb 2, 2018

Can you merge this with dev, so we can push it into PO Review? :)

@usame-algan usame-algan removed their assignment Mar 29, 2023
@usame-algan usame-algan closed this Jun 2, 2023
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.

events should not be deleteable after their start date
3 participants