Skip to content

Commit

Permalink
Merge branch 'dev' into feature/recurring-meeting-ics
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmir authored Dec 6, 2024
2 parents 8f169ae + dff8e6f commit 07ae967
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/views/groups/_memberships.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See COPYRIGHT and LICENSE files for more details.
++#%>
<% roles = Role.givable %>
<% roles = ProjectRole.givable %>
<% projects = Project.active.order(Arel.sql('lft')) %>
<% memberships = @group.memberships %>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,17 @@
post template_completed_recurring_meeting_path(recurring_meeting)
end

subject do
Timecop.freeze("2024-12-04T10:00:00Z".to_datetime) { request }
end

before do
login_as(current_user)
end

context "when first occurrence is not existing" do
it "instantiates the first occurrence from template" do
expect { request }.to change(recurring_meeting.scheduled_meetings, :count).by(1)
expect { subject }.to change(recurring_meeting.scheduled_meetings, :count).by(1)
expect(response).to be_redirect

expect(recurring_meeting.scheduled_meetings.count).to eq(1)
Expand All @@ -81,7 +85,7 @@
end

it "does not create a new meeting" do
expect { request }.not_to change(recurring_meeting.scheduled_meetings, :count)
expect { subject }.not_to change(recurring_meeting.scheduled_meetings, :count)
expect(response).to be_redirect

expect(recurring_meeting.scheduled_meetings.count).to eq(1)
Expand All @@ -99,7 +103,7 @@
end

it "takes over that occurrence" do
expect { request }.to change(recurring_meeting.meetings, :count).by(1)
expect { subject }.to change(recurring_meeting.meetings, :count).by(1)
expect(response).to be_redirect

expect(recurring_meeting.scheduled_meetings.count).to eq(1)
Expand All @@ -113,7 +117,7 @@
let(:current_user) { create(:user) }

it "does not authorize" do
request
subject
expect(response).to have_http_status(:not_found)
end
end
Expand Down

0 comments on commit 07ae967

Please sign in to comment.