Got content added to new pages.
This commit is contained in:
14
src/lib.rs
14
src/lib.rs
@ -132,7 +132,13 @@ impl MoreThanText {
|
||||
reply.get_data("sess_id").unwrap().to_uuid().unwrap()
|
||||
}
|
||||
|
||||
pub fn get_document<S>(&self, sess_id: Uuid, action: ActionType, doc_name: S) -> MTTReply
|
||||
pub fn get_document<S>(
|
||||
&self,
|
||||
sess_id: Uuid,
|
||||
action: ActionType,
|
||||
doc_name: S,
|
||||
data: String,
|
||||
) -> MTTReply
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
@ -140,7 +146,7 @@ impl MoreThanText {
|
||||
msg.add_data("sess_id", sess_id);
|
||||
msg.add_data("action", action);
|
||||
msg.add_data("name", doc_name.into());
|
||||
msg.add_data("doc", "splat");
|
||||
msg.add_data("doc", data);
|
||||
let rx = self.client_channel.send(msg);
|
||||
let reply = rx.recv().unwrap();
|
||||
MTTReply::new(reply)
|
||||
@ -176,7 +182,7 @@ mod mtt {
|
||||
fn get_root_document_with_str() {
|
||||
let mut mtt = MoreThanText::new();
|
||||
let id = mtt.validate_session(Some(Uuid::new_v4()));
|
||||
let output = mtt.get_document(id, ActionType::Get, "root");
|
||||
let output = mtt.get_document(id, ActionType::Get, "root", "".to_string());
|
||||
assert!(output.get_error().is_none());
|
||||
}
|
||||
|
||||
@ -184,7 +190,7 @@ mod mtt {
|
||||
fn get_root_document_with_string() {
|
||||
let mut mtt = MoreThanText::new();
|
||||
let id = mtt.validate_session(Some(Uuid::new_v4()));
|
||||
let output = mtt.get_document(id, ActionType::Get, "root".to_string());
|
||||
let output = mtt.get_document(id, ActionType::Get, "root".to_string(), "".to_string());
|
||||
assert!(output.get_error().is_none());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user