mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-06 03:34:57 +08:00
Create write-protected file on the fly in tests
This commit is contained in:
parent
83b94c6b0b
commit
cf35a46ecf
2 changed files with 6 additions and 3 deletions
|
@ -78,10 +78,14 @@ defmodule LivebookWeb.HomeLiveTest do
|
|||
|> has_element?()
|
||||
end
|
||||
|
||||
test "disables open when a write-protected notebook is selected", %{conn: conn} do
|
||||
@tag :tmp_dir
|
||||
test "disables open when a write-protected notebook is selected",
|
||||
%{conn: conn, tmp_dir: tmp_dir} do
|
||||
{:ok, view, _} = live(conn, "/")
|
||||
|
||||
path = test_notebook_path("write_protected")
|
||||
path = Path.join(tmp_dir, "write_protected.livemd")
|
||||
File.touch!(path)
|
||||
File.chmod!(path, 0o444)
|
||||
|
||||
view
|
||||
|> element("form")
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
# Write-protected notebook
|
Loading…
Add table
Reference in a new issue